https://github.com/lsongdev/nagent
simple user-agent parser for Node.js
https://github.com/lsongdev/nagent
ua-parser user-agent
Last synced: 3 months ago
JSON representation
simple user-agent parser for Node.js
- Host: GitHub
- URL: https://github.com/lsongdev/nagent
- Owner: lsongdev
- License: isc
- Created: 2018-01-04T08:32:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-12T06:22:14.000Z (almost 6 years ago)
- Last Synced: 2025-02-13T22:23:44.716Z (3 months ago)
- Topics: ua-parser, user-agent
- Language: JavaScript
- Homepage: https://npmjs.org/nagent
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## nagent [](https://npmjs.org/nagent)
>
### Installation
```bash
$ npm install nagent
```### Example
```js
const UserAgent = require('nagent');const ua = UserAgent.parse('Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13D15 MicroMessenger/6.3.9 NetType/WIFI Language/zh_CN');
// [
// {
// "ProductName": "Mozilla",
// "ProductVersion": "5.0",
// "SystemInformation": {
// "Platform": "iPhone",
// "ReleaseVersion": "CPU iPhone OS 11_0_3 like Mac OS X",
// "_": []
// }
// },
// {
// "PlatformName": "AppleWebKit",
// "PlatformVersion": "604.1.38",
// "PlatformDetail": "KHTML, like Gecko"
// },
// {
// "PlatformName": "Mobile",
// "PlatformVersion": "15A432"
// },
// {
// "PlatformName": "Nebula"
// },
// {
// "PlatformName": "PSDType",
// "PlatformDetail": "1"
// },
// {
// "PlatformName": "AlipayDefined",
// "PlatformDetail": "nt:WIFI,ws:320|504|2.0"
// },
// {
// "PlatformName": "AliApp",
// "PlatformDetail": "AP/10.1.5.102407"
// },
// {
// "PlatformName": "AlipayClient",
// "PlatformVersion": "10.1.5.102407"
// },
// {
// "PlatformName": "Alipay"
// },
// {
// "PlatformName": "Language",
// "PlatformVersion": "en"
// }
// ]```
### Contributing
- Fork this Repo first
- Clone your Repo
- Install dependencies by `$ npm install`
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3### ISC
This work is licensed under the [ISC license](./LICENSE).
---