JSPM

  • Created
  • Published
  • Downloads 1519167
  • Score
    100M100P100Q207532F
  • License MIT

detects bots/crawlers/spiders via the user agent.

Package Exports

  • isbot

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (isbot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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