uap
user-agent-parse
npm i user-agent-parse
uap

user-agent-parse

library for Node to parse user agents

by Jujhar Singh

0.1.12 (see all)License:MITTypeScript:Not FoundCategories:Node.js User Agent Parsing
npm i user-agent-parse
Readme

Node User Agent Parse

Very simple, no deps user agent string parser.

NPM Build Status

Overview

Parse user agents a bit like PHP's get_browser(). Rudimentary but it works.

Example Usage

const userAgent = require('user-agent');
userAgent.parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/526.9 (KHTML, like Gecko) Version/4.0dp1 Safari/526.8');
// => { name: 'safari', version: '4.0dp1', os: 'Windows XP', full: '... same string as above ...', device_type:'desktop' }

Tests

See /test/test.js for a simple suite

Credits

Heavily based on (blatantly ripped from ahem) https://github.com/soldair/node-ua-device-type and https://github.com/jujhars13/node-user-agent-parse

License

License is MIT, go nuts.

Downloads/wk

408

GitHub Stars

15

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.1.12
latest
3yrs ago
No tutorials found
Add a tutorial