Package Exports
- detect-mobile-browser
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (detect-mobile-browser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Detect Mobile Browser
Small plugin to detect mobile browser
Usage Frotnend:-
alert(SmartPhone.isAndriod());OR
alert(SmartPhone.isAny());Usage Backend:-
User as a ExpressJS middleware
var mobileBrowser = require('./detect-browser');
...
...
app.use(mobileBrowser());
app.get('/', function (req, res){
...
...
//in req
console.log(req.SmartPhone.isAny());
...
...
//in res locals to use in templates
console.log(res.locals.SmartPhone.isAny());
...
...
});
Bower
$ bower install browser-detector --saveNPM
$ npm install detect-mobile-browser --save