2.0.2 • Published 3 years ago

@routes/isbot v2.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

@routes/isbot

🕷 Express middleware to detect crawler requests: request.isbot

The middleware adds a getter to the request: isbot.

  • ✅ Lazy processing: performs the check only if it's actually used
  • ✅ Memoisation: Operation result is cached
  • ✅ Quick and Simple: Only check if it's a known crawler, does not parse the user agent string to a complex object
  • ✅ Customisable bot list
const isbot = require('@routes/isbot');

app.use(isbot);

app.get('/api', (request, response) => {
	if (request.isbot) {
		// do things
	}
	...

	response.sendStatus(200);
});

Customisation

All customisation options from isbot package are also available here

isbot.exclude(['bot']);
isbot.extend(['(?<! cu)bot']);
2.0.2

3 years ago

2.0.1

4 years ago

2.0.0-rc.1

4 years ago

2.0.0

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago