https://github.com/anzerr/agent.util
Parse and fetch info found inside user-agent.
https://github.com/anzerr/agent.util
html http info nodejs user-agent util
Last synced: about 1 year ago
JSON representation
Parse and fetch info found inside user-agent.
- Host: GitHub
- URL: https://github.com/anzerr/agent.util
- Owner: anzerr
- License: mit
- Created: 2020-08-14T00:13:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-28T10:12:25.000Z (over 5 years ago)
- Last Synced: 2025-02-02T16:16:50.590Z (about 1 year ago)
- Topics: html, http, info, nodejs, user-agent, util
- Language: JavaScript
- Homepage:
- Size: 215 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### `Intro`



Parse and fetch info found inside user-agent
#### `Install`
``` bash
npm install --save git+https://git@github.com/anzerr/agent.util.git
npm install --save @anzerr/agent.util
```
### `Example`
``` javascript
const {UserAgent} = require('@anzerr/agent.util');
const u = new UserAgent();
const agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36';
console.log(u.get(agent), agent);
/*
{
os: null,
phone: null,
tablet: null,
valid: { tablet: false, phone: false },
uas: [],
props: [
{ key: 'Safari', version: '537.36' },
{ key: 'Webkit', version: '537.36' },
{ key: 'Chrome', version: '84.0.4147.105' },
{ key: 'Windows NT', version: '10.0' }
],
utils: [ { key: 'WebKit', version: '537.36' } ]
} Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
*/
```