Skip to content
forked from omrilotan/isbot

💻 JavaScript module that detects bots/crawlers/spiders via the user agent

License

Notifications You must be signed in to change notification settings

chinesedfan/isbot

 
 

Repository files navigation

isbot

Build Status

install

$ npm install isbot --save

usage

isBot(req.headers['user-agent'])

isBot("Googlebot/2.1 (+http://www.google.com/bot.html)") // true

isBot("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36") // false

extending

isBot("Mozilla/5.0") // false

var myList = [
    'istat',
    'newspaper',
    'httpclient',
    '^mozilla/\\d\\.\\d$',
];

isBot.extend(myList);

isBot("Mozilla/5.0") // true

excluding

isBot('Ceramic Tile Installation Guide') // true

var myList = [
	'Ceramic Tile Installation Guide',
	'NORAD National Defence Network'
];

isBot.exclude(myList);

isBot('Ceramic Tile Installation Guide') // false

About

💻 JavaScript module that detects bots/crawlers/spiders via the user agent

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%