
Security News
TypeScript Native Previews: 10x Faster Compiler Now on npm for Public Testing
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.
@nodebb/spider-detector
Advanced tools
A tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS
A tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS
It might be useful when you have a single page app but want to deliver static pages for spiders.
npm install spider-detector // or `yarn install spider-detector`
const detector = require('spider-detector')
detector.isSpider('baiduspider') // return true
const detector = require('spider-detector')
const express = require('express')
const app = express()
app.use(detector.middleware())
app.get('/*', function(req, res) {
if (req.isSpider()) {
// do something else, i.E. send a static page
} else {
// send single page app
}
})
Well, 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.
Yep, 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.
FAQs
A tiny node module to detect spiders/crawlers quickly and comes with optional middleware for ExpressJS
The npm package @nodebb/spider-detector receives a total of 862 weekly downloads. As such, @nodebb/spider-detector popularity was classified as not popular.
We found that @nodebb/spider-detector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.
Research
Security News
Malicious npm packages targeting React, Vue, Vite, Node.js, and Quill remained undetected for two years while deploying destructive payloads.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.