1.0.1 • Published 9 years ago

connect-is-bot v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

connect-is-bot

adds isBot to the request, when requested from a bot, search engine, spider or the like.

install

npm install connect-is-bot --save

usage

var isBot = require('connect-is-bot');
app.use(isBot());

-> it adds the attribute req.isBot to every request that comes from a bot, search engine, spider or the like. e.g. when a request contains the 'user-agent' header:

"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" ,

the property req.isBot is set to true.

credits

it uses the is-bot module from gjohnson.