{"_id":"@nodebb/spider-detector","_rev":"1-6396824495e9b3e6f5146ce113f89792","name":"@nodebb/spider-detector","description":"A tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS","dist-tags":{"latest":"2.0.3"},"versions":{"2.0.2":{"name":"@nodebb/spider-detector","version":"2.0.2","keywords":["crawler","detector","spider","bot","middleware","single page app","expressjs"],"author":{"url":"https://binarykitchen.com","name":"Michael Heuberger","email":"michael.heuberger@binarykitchen.com"},"license":"MIT","_id":"@nodebb/spider-detector@2.0.2","maintainers":[{"name":"julianlam","email":"julian@nodebb.org"},{"name":"baris","email":"barisusakli@gmail.com"},{"name":"psychobunny","email":"andrew@nodebb.org"},{"name":"pitaj","email":"p.jaszkow@gmail.com"}],"homepage":"https://github.com/binarykitchen/spider-detector#readme","bugs":{"url":"https://github.com/binarykitchen/spider-detector/issues"},"dist":{"shasum":"54c1ad1b2f79d5d88c2a0cb67198d604d68316cb","tarball":"https://registry.npmjs.org/@nodebb/spider-detector/-/spider-detector-2.0.2.tgz","fileCount":8,"integrity":"sha512-tbeLljIwuMXhAGh/J6UND2/8cA+MKKD2mOaJAwOpxNbVkhOkFJ/2Yk+rIQpCfZHqAVrJznp6rptGJv1G50TNBw==","signatures":[{"sig":"MEUCIQCvPkRfygnZVKajfhZo0+AM8KNX8nQhcpgkfItViZDjfAIgGrWgAQR9rfKLbYa01CU9GAnD3VoAd6dVl7x5mmNbQi4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8125},"main":"index.js","engines":{"npm":">=6.9.0","node":">=8.15.0","yarn":">=1.17.3"},"gitHead":"06df2330e73a2df8e11a38950f9a43105999375a","scripts":{"test":"tape test/*.js"},"_npmUser":{"name":"baris","email":"barisusakli@gmail.com"},"repository":{"url":"git+ssh://git@github.com/binarykitchen/spider-detector.git","type":"git"},"_npmVersion":"10.2.5","description":"A tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS","directories":{},"_nodeVersion":"20.5.1","_hasShrinkwrap":false,"devDependencies":{"tape":"4.11.0","express":"4.18.2","superagent":"5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/spider-detector_2.0.2_1718041649606_0.3238728764237475","host":"s3://npm-registry-packages"}},"2.0.3":{"name":"@nodebb/spider-detector","version":"2.0.3","description":"A tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS","main":"index.js","author":{"name":"Michael Heuberger","email":"michael.heuberger@binarykitchen.com","url":"https://binarykitchen.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/binarykitchen/spider-detector.git"},"scripts":{"test":"tape test/*.js"},"engines":{"node":">=8.15.0","npm":">=6.9.0","yarn":">=1.17.3"},"keywords":["crawler","detector","spider","bot","middleware","single page app","expressjs"],"license":"MIT","devDependencies":{"express":"4.18.2","superagent":"5.1.0","tape":"4.11.0"},"_id":"@nodebb/spider-detector@2.0.3","gitHead":"333334c6711a047c77c8a52388c72d3f46e15d32","bugs":{"url":"https://github.com/binarykitchen/spider-detector/issues"},"homepage":"https://github.com/binarykitchen/spider-detector#readme","_nodeVersion":"20.5.1","_npmVersion":"10.2.5","dist":{"integrity":"sha512-JgoRxGnsZl74eHjNqosgw2xGyEAgc5wjRBOwCBYRTK/BSSswPG/tmFzkQAvuQQccqFB/XmkTppUQT9k5pyGCrg==","shasum":"c0b0acde7223381034d9b3cfb10539ac5a5b57c5","tarball":"https://registry.npmjs.org/@nodebb/spider-detector/-/spider-detector-2.0.3.tgz","fileCount":8,"unpackedSize":8125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUviN/bvDSL2XaKz8AgHPvV3atofPvkbxZjHuxdNth1QIgSwePHfiZzyTVN6OTcAOLme770BjMMtHREXawsXGHdoc="}]},"_npmUser":{"name":"baris","email":"barisusakli@gmail.com"},"directories":{},"maintainers":[{"name":"julianlam","email":"julian@nodebb.org"},{"name":"baris","email":"barisusakli@gmail.com"},{"name":"psychobunny","email":"andrew@nodebb.org"},{"name":"pitaj","email":"p.jaszkow@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spider-detector_2.0.3_1718041673685_0.7943022200253669"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-10T17:47:29.501Z","modified":"2024-06-10T17:47:54.064Z","2.0.2":"2024-06-10T17:47:29.744Z","2.0.3":"2024-06-10T17:47:53.830Z"},"maintainers":[{"name":"julianlam","email":"julian@nodebb.org"},{"name":"baris","email":"barisusakli@gmail.com"},{"name":"psychobunny","email":"andrew@nodebb.org"},{"name":"pitaj","email":"p.jaszkow@gmail.com"}],"author":{"name":"Michael Heuberger","email":"michael.heuberger@binarykitchen.com","url":"https://binarykitchen.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/binarykitchen/spider-detector.git"},"keywords":["crawler","detector","spider","bot","middleware","single page app","expressjs"],"license":"MIT","homepage":"https://github.com/binarykitchen/spider-detector#readme","bugs":{"url":"https://github.com/binarykitchen/spider-detector/issues"},"readme":"# spider-detector\n\n[![Build Status](https://travis-ci.org/binarykitchen/spider-detector.svg?branch=master)](https://travis-ci.org/binarykitchen/spider-detector) [![npm version](https://badge.fury.io/js/spider-detector.svg)](https://badge.fury.io/js/spider-detector)\n\nA tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS\n\nIt might be useful when you have a single page app but want to deliver static pages for spiders.\n\n## Install\n\n```\nnpm install spider-detector // or `yarn install spider-detector`\n```\n\n## Direct Example\n\n```js\nconst detector = require('spider-detector')\ndetector.isSpider('baiduspider') // return true\n```\n\n## ExpressJS example\n\n```js\nconst detector = require('spider-detector')\nconst express = require('express')\nconst app = express()\n\napp.use(detector.middleware())\n\napp.get('/*', function(req, res) {\n  if (req.isSpider()) {\n    // do something else, i.E. send a static page\n  } else {\n    // send single page app\n  }\n})\n```\n\n## Why? There are already modules out there\n\nWell, I wanted one which does not use `readFileSync` and comes with optional middleware. Furthermore some hackers do not classify Googlebot as a spider anymore which poses a problem sometimes, see next question.\n\n## What about Googlebot?\n\nYep, Googlebot is able to deal with single page apps but this feature is pretty unstable. Especially under AngularJS when hash fragments are disabled with `$locationProvider.html5Mode(true)`. That's why - against all odds - I have classified `googlebot` as a spider in this module.\n","readmeFilename":"README.md"}