mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
parent
6821276669
commit
31f94f3a51
1219
dist/ua-parser.mjs
vendored
Normal file
1219
dist/ua-parser.mjs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -139,14 +139,20 @@
|
|||||||
"yuanyang <work_yuanyang@163.com>",
|
"yuanyang <work_yuanyang@163.com>",
|
||||||
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
|
"Yun Young-jin <yupmin@yupmin-office-macmini.local>",
|
||||||
"Zach Bjornson <zbbjornson@gmail.com>"
|
"Zach Bjornson <zbbjornson@gmail.com>"
|
||||||
],
|
],
|
||||||
|
"type": "commonjs",
|
||||||
"main": "src/ua-parser.js",
|
"main": "src/ua-parser.js",
|
||||||
|
"module": "dist/ua-parser.mjs",
|
||||||
|
"exports": {
|
||||||
|
"require": "./src/ua-parser.js",
|
||||||
|
"import": "./dist/ua-parser.mjs"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle",
|
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle && node -e \"const fs=require('fs');fs.writeFileSync('dist/ua-parser.mjs','// Generated ESM version of UAParser.js\\n// Source file: /src/ua-parser.js\\n\\n'+fs.readFileSync('src/ua-parser.js','utf-8').replace(/\\(func[\\s\\S]+strict\\';/ig,'const window = undefined;').replace(/\\/[\\/\\s]+export[\\s\\S]+/ig,'export {UAParser};'),'utf-8')\"",
|
||||||
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
|
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
|
||||||
"test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js",
|
"test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js",
|
||||||
"verup": "node ./node_modules/verup",
|
"verup": "node ./node_modules/verup",
|
||||||
|
@ -473,6 +473,12 @@ http.createServer(function (req, res) {
|
|||||||
console.log('Server running at http://127.0.0.1:1337/');
|
console.log('Server running at http://127.0.0.1:1337/');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Using ES Modules
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { UAParser } from 'ua-parser-js';
|
||||||
|
```
|
||||||
|
|
||||||
## Using TypeScript
|
## Using TypeScript
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user