A platform detection library that works on nearly all JavaScript platforms.
This module provides the below platfrom based information:
description
layout
manufacturer
name
prerelease
product
ua
version
os
It can also parse an User-Agent and give the same information.
P.S:platform is for informational purposes only & not intended as a substitution for feature detection/inference checks.
GET IT : npm install --save platform
Sample usage:
12345678910
varplatform=require('platform');// on an iPadplatform.name;// 'Safari'platform.version;// '5.1'platform.product;// 'iPad'platform.manufacturer;// 'Apple'platform.layout;// 'WebKit'platform.os;// 'iOS 5.0'platform.description;// 'Safari 5.1 on Apple iPad (iOS 5.0)'
123456
varinfo=platform.parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7.2; en; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 11.52');info.name;// 'Opera'info.version;// '11.52'info.layout;// 'Presto'info.os;// 'Mac OS X 10.7.2'info.description;// 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.2'