Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (29 sloc) 1.01 KB

funnelweb Build Status

Tries to detect if a request is coming from a machine or a person using a regular expression. Bot and browser User-Agent strings sourced from


$ npm install funnelweb


Funnelweb just takes a user agent string and returns "true" if it's probably a bot, or "false" otherwise.

var funnelweb = require('funnelweb')

funnelweb('GoogleBot') // true
funnelweb('Google Chrome') // false

If you pass it an HTTP request object, it'll read the User-Agent header and do the same:

var funnelweb = require('funnelweb')
  , http = require('http')

http.createServer(function(req, res) {
  var response = funnelweb(req)

  if (bot) {
    res.end('you are a bot')
  } else {
    res.end('you are not a bot')