UNPKG

detect-bot

Version:

Detects whether current request is from bot. Mandatory if you want to use PhantomJS.

26 lines (15 loc) 363 B
# detect-bot > Detects whether current request is from bot. Mandatory if you want to use PhantomJS. ## Install ``` $ npm install --save detect-bot ``` ## Usage ```js const detectBot = require('detect-bot'); if(detectBot(req.headers['user-agent'])) { //run PhantomJS } ``` ## License MIT © [Rohit Singhal](https://www.xtendify.com/en/user/2-rosinghal)