mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Add new feature: parse user-agent in CLI using npx ua-parser-js "[INSERT-UA-HERE]"
and print the result in JSON format
This commit is contained in:
parent
e87c794fd9
commit
150d3c6b4a
@ -196,6 +196,7 @@
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"bin": "./script/cli.js",
|
||||
"scripts": {
|
||||
"build": "./script/build-dist.sh && ./script/build-module.js",
|
||||
"build+test": "npm run build && npm run test",
|
||||
|
4
script/cli.js
Executable file
4
script/cli.js
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const UAParser = require('ua-parser-js');
|
||||
console.log(JSON.stringify(process.argv.slice(2).map(ua => UAParser(ua))));
|
Loading…
x
Reference in New Issue
Block a user