user agent based device type sniffer tablet||phone||tv||desktop
User agent based device type sniffer tablet||mobile||desktop||tv.
Based almost wholely on the matching code from the npm package express-device by rguerreiro
var deviceType = ;
deviceType(user agent string, [optional options])
options is an object
- if no user agent is passed or the user agent is empty this option will be returned.
- defaults to "desktop"
- instead of "phone" if unknown the value if this option will be returned
- defaults to "phone"
- instead of "bot" the value of this option will be returned.
Special thanks to rguerreiro author of https://github.com/rguerreiro/express-device
who tracked down the device matching code from https://github.com/bjankord/Categorizr
I needed to use this without using express. its a small lib so i bundled it up for all to enjoy.