Registry / security / udger-nodejs

udger-nodejs

JSON →
library1.5.1jsnpmunverified

Udger-nodejs is a local user-agent string and IP address parser for Node.js that leverages Udger's SQLite database (data ver. 3) to detect devices (desktop, tablet, Smart TV, game console), operating systems, client software types (browser, email client), device market names, and IP classifications (public proxies, VPNs, Tor exit nodes, fake crawlers, web scrapers, datacenter names). Version 1.5.1 requires Node.js >= 8.9.0 and a datafile from https://data.udger.com/. It features LRU caching and is tested against 50,000+ unique user agents. Key differentiators include local, offline operation for privacy and speed, and comprehensive IP intelligence alongside UA parsing.

npm install udger-nodejs
INSTALL
IMPORT
SIG · UDGER-NODEJS
U
udger-nodejs
securityjavascriptv1.5.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

udgerParser
const udgerParser = require('udger-nodejs')('./udgerdb_v3.dat')
import udgerParser from 'udger-nodejs'
CJS only; no default export. Path to .dat file required.
parse
ret = udgerParser.parse()
ret = udgerParser.parse('Mozilla/5.0 ...')
parse() reads from internal state set via set().
set
udgerParser.set({ua: '...', ip: '...'})
udgerParser.set('Mozilla/5.0 ...')
set() expects object, not string.

Shows CJS require, setting UA and IP via set(), parsing, and logging result.

const udgerParser = require('udger-nodejs')('./udgerdb_v3.dat'); udgerParser.set({ ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', ip: '2A02:598:7000:116:0:0:0:101' }); let ret = udgerParser.parse(); console.log(JSON.stringify(ret, null, 4));
Debug
Known issues
breakingData file v2 is not supported in v1.5+
fix
Download udgerdb_v3.dat from https://data.udger.com/ and use it as the data source.
affects: >=1.0
deprecatedConstructor accepting no arguments is deprecated; a data file path is required.
fix
Always pass the path to the .dat file when calling require() or use setDatafile() before parse().
affects: >=1.5
gotchaNode.js version must be >= 8.9.0; older versions cause errors
fix
Upgrade Node.js to version 8.9.0 or later.
affects: >=1.0
gotchaBoth `ua` and `ip` fields in set() are optional but at least one is needed for meaningful results
fix
Ensure at least one of `ua` or `ip` is provided in the object passed to set().
affects: >=1.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open './udgerdb_v3.dat'
Data file path is invalid or missing
fix
Download udgerdb_v3.dat from https://data.udger.com/ and provide correct path.
TypeError: udgerParser.set is not a function
Attempted to use ES6 import style on CJS-only module
fix
Use const udgerParser = require('udger-nodejs')('./path/to/data.dat')
Upgrade
Version history
1.5.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
udger-nodejs — npm install udger-nodejs · libregistry