Remove disabled CLI functionality

See #268
This commit is contained in:
Max Nordlund 2019-03-25 12:11:07 +01:00 committed by Max Nordlund gmail
parent a4da1e2b65
commit d1a7f365ad
No known key found for this signature in database
GPG Key ID: 995D5074B7F9E79F
2 changed files with 0 additions and 42 deletions

View File

@ -241,18 +241,6 @@ $ npm install --save @types/ua-parser-js
# https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js # https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js
``` ```
## Using CLI
```sh
$ node ua-parser.min.js "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)"
# multiple args
$ node ua-parser.min.js "Opera/1.2" "Opera/3.4"
# piped args
$ echo "Opera/1.2" | node ua-parser.min.js
# log file
$ cat ua.log | node ua-parser.min.js
```
## Using jQuery/Zepto ($.ua) ## Using jQuery/Zepto ($.ua)
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`. Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`.

View File

@ -1012,7 +1012,6 @@
NAME : NAME, NAME : NAME,
VERSION : VERSION VERSION : VERSION
}; };
//UAParser.Utils = util;
/////////// ///////////
// Export // Export
@ -1025,35 +1024,6 @@
if (typeof module !== UNDEF_TYPE && module.exports) { if (typeof module !== UNDEF_TYPE && module.exports) {
exports = module.exports = UAParser; exports = module.exports = UAParser;
} }
// TODO: test!!!!!!!!
/*
if (require && require.main === module && process) {
// cli
var jsonize = function (arr) {
var res = [];
for (var i in arr) {
res.push(new UAParser(arr[i]).getResult());
}
process.stdout.write(JSON.stringify(res, null, 2) + '\n');
};
if (process.stdin.isTTY) {
// via args
jsonize(process.argv.slice(2));
} else {
// via pipe
var str = '';
process.stdin.on('readable', function() {
var read = process.stdin.read();
if (read !== null) {
str += read;
}
});
process.stdin.on('end', function () {
jsonize(str.replace(/\n$/, '').split('\n'));
});
}
}
*/
exports.UAParser = UAParser; exports.UAParser = UAParser;
} else { } else {
// requirejs env (optional) // requirejs env (optional)