Skip to content

Check if client browser matches rules defined with semver syntax in Node.js

Notifications You must be signed in to change notification settings

NoumanSaleem/browser-support

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

browser-support

Check if client browser matches rules defined with semver syntax in Node.js

###Installation

$ npm install browser-check

##Examples ###Redirect users using IE versions below 8 using Express.js

var browserCheck = require('browser-check');
app.use(function (req, res, next) {
	var unsupported = browserCheck(req.headers['user-agent'], { "IE": "<8" });
	if (unsupported) return res.redirect('http://google.com');
	next();
});

About

Check if client browser matches rules defined with semver syntax in Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published