@xianyukeji/isbot

2.3.0 • Public • Published

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

Package Sidebar

Install

npm i @xianyukeji/isbot

Weekly Downloads

1

Version

2.3.0

License

MIT

Unpacked Size

737 kB

Total Files

13

Last publish

Collaborators

  • jackliulovelt
  • mikuscallion