ua-browser 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +206 -204
- package/index.js +6 -6
- package/package.json +63 -63
- package/dist/index.cjs.js +0 -571
- package/dist/index.d.ts +0 -140
- package/dist/index.esm.mjs +0 -569
- package/dist/index.min.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 yangtianxia
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 yangtianxia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,204 +1,206 @@
|
|
|
1
|
-
# uaBrowser - 浏览器检测
|
|
2
|
-
|
|
3
|
-
通过userAgent和浏览器环境变量检测浏览器、系统及设备类型的常用工具
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
uaBrowser
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
uaBrowser.
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
uaBrowser.
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
uaBrowser.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| '
|
|
61
|
-
| '
|
|
62
|
-
| '
|
|
63
|
-
| '
|
|
64
|
-
| '
|
|
65
|
-
| '
|
|
66
|
-
| '
|
|
67
|
-
| '
|
|
68
|
-
| '
|
|
69
|
-
| '
|
|
70
|
-
| '
|
|
71
|
-
| '
|
|
72
|
-
| '
|
|
73
|
-
| '
|
|
74
|
-
| '
|
|
75
|
-
| '
|
|
76
|
-
| '
|
|
77
|
-
| '
|
|
78
|
-
| '
|
|
79
|
-
| '
|
|
80
|
-
| '
|
|
81
|
-
| '
|
|
82
|
-
| '
|
|
83
|
-
| '
|
|
84
|
-
| '
|
|
85
|
-
| '
|
|
86
|
-
| '
|
|
87
|
-
| '
|
|
88
|
-
| '
|
|
89
|
-
| '
|
|
90
|
-
| '
|
|
91
|
-
| '
|
|
92
|
-
| '
|
|
93
|
-
| '
|
|
94
|
-
| '
|
|
95
|
-
| '
|
|
96
|
-
| '
|
|
97
|
-
| '
|
|
98
|
-
| '
|
|
99
|
-
| '
|
|
100
|
-
| '
|
|
101
|
-
| '
|
|
102
|
-
| '
|
|
103
|
-
| '
|
|
104
|
-
| '
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
| '
|
|
116
|
-
| '
|
|
117
|
-
| '
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
| '
|
|
129
|
-
| '
|
|
130
|
-
| '
|
|
131
|
-
| '
|
|
132
|
-
| '
|
|
133
|
-
| '
|
|
134
|
-
| '
|
|
135
|
-
| '
|
|
136
|
-
| '
|
|
137
|
-
| '
|
|
138
|
-
| '
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
203
|
-
|
|
204
|
-
|
|
1
|
+
# uaBrowser - 浏览器检测
|
|
2
|
+
|
|
3
|
+
通过userAgent和浏览器环境变量检测浏览器、系统及设备类型的常用工具
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
### npm
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i ua-browser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### pnpm
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add ua-browser
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### yarn
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
yarn add ua-browser
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 支持方法
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { uaBrowser } from 'ua-browser'
|
|
29
|
+
|
|
30
|
+
/** 浏览器解析 */
|
|
31
|
+
uaBrowser(ua?: string): {
|
|
32
|
+
version: string;
|
|
33
|
+
osVersion: string;
|
|
34
|
+
engine: string;
|
|
35
|
+
browser: string;
|
|
36
|
+
os: string;
|
|
37
|
+
device: string;
|
|
38
|
+
isWebview: boolean;
|
|
39
|
+
language: string;
|
|
40
|
+
platfrom: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** 检查 `webview` 浏览环境,仅支持 `android` */
|
|
44
|
+
uaBrowser.isWebview(ua: string): boolean
|
|
45
|
+
|
|
46
|
+
/** 检查微信小程序 */
|
|
47
|
+
uaBrowser.isWechatMiniapp(): boolean
|
|
48
|
+
|
|
49
|
+
/** 浏览器语言 */
|
|
50
|
+
uaBrowser.getLanguage(): string
|
|
51
|
+
|
|
52
|
+
/** 当前版本 */
|
|
53
|
+
uaBrowser.VERSION: string
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 浏览器
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
type browser =
|
|
60
|
+
| 'Safari'
|
|
61
|
+
| 'Chrome'
|
|
62
|
+
| 'IE'
|
|
63
|
+
| 'Edge'
|
|
64
|
+
| 'Firefox'
|
|
65
|
+
| 'Firefox Focus'
|
|
66
|
+
| 'Chromium'
|
|
67
|
+
| 'Opera'
|
|
68
|
+
| 'Vivaldi'
|
|
69
|
+
| 'Yandex'
|
|
70
|
+
| 'Arora'
|
|
71
|
+
| 'Lunascape'
|
|
72
|
+
| 'QupZilla'
|
|
73
|
+
| 'Coc Coc'
|
|
74
|
+
| 'Kindle'
|
|
75
|
+
| 'Iceweasel'
|
|
76
|
+
| 'Konqueror'
|
|
77
|
+
| 'Iceape'
|
|
78
|
+
| 'SeaMonkey'
|
|
79
|
+
| 'Epiphany'
|
|
80
|
+
| '360'
|
|
81
|
+
| '360EE'
|
|
82
|
+
| '360SE'
|
|
83
|
+
| 'UC'
|
|
84
|
+
| 'QQBrowser'
|
|
85
|
+
| 'QQ'
|
|
86
|
+
| 'Baidu'
|
|
87
|
+
| 'Maxthon'
|
|
88
|
+
| 'Sogou'
|
|
89
|
+
| 'Liebao'
|
|
90
|
+
| '2345Explorer'
|
|
91
|
+
| '115Browser'
|
|
92
|
+
| 'TheWorld'
|
|
93
|
+
| 'XiaoMi'
|
|
94
|
+
| 'Quark'
|
|
95
|
+
| 'Qiyu'
|
|
96
|
+
| 'Wechat'
|
|
97
|
+
| 'WechatWork'
|
|
98
|
+
| 'Taobao'
|
|
99
|
+
| 'Alipay'
|
|
100
|
+
| 'Weibo'
|
|
101
|
+
| 'Douban'
|
|
102
|
+
| 'Suning'
|
|
103
|
+
| 'iQiYi'
|
|
104
|
+
| 'DingTalk'
|
|
105
|
+
| 'Huawei'
|
|
106
|
+
| 'Vivo'
|
|
107
|
+
| 'Firefox Nightly'
|
|
108
|
+
| 'Wechat Miniapp'
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 内核
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
type engine =
|
|
115
|
+
| 'Trident'
|
|
116
|
+
| 'Presto'
|
|
117
|
+
| 'WebKit'
|
|
118
|
+
| 'Gecko'
|
|
119
|
+
| 'KHTML'
|
|
120
|
+
| 'Blink'
|
|
121
|
+
| 'EdgeHTML'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 系统或平台
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
type os =
|
|
128
|
+
| 'Windows'
|
|
129
|
+
| 'Linux'
|
|
130
|
+
| 'MacOS'
|
|
131
|
+
| 'Android'
|
|
132
|
+
| 'HarmonyOS'
|
|
133
|
+
| 'Ubuntu'
|
|
134
|
+
| 'FreeBSD'
|
|
135
|
+
| 'Debian'
|
|
136
|
+
| 'Windows Phone'
|
|
137
|
+
| 'BlackBerry'
|
|
138
|
+
| 'MeeGo'
|
|
139
|
+
| 'Symbian'
|
|
140
|
+
| 'iOS'
|
|
141
|
+
| 'Chrome OS'
|
|
142
|
+
| 'WebOS'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 设备类型
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
type device =
|
|
149
|
+
| 'Mobile'
|
|
150
|
+
| 'Tablet'
|
|
151
|
+
| 'Pc'
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 浏览器支持
|
|
155
|
+
|
|
156
|
+
| 浏览器 | 标识 |
|
|
157
|
+
| :-- | :-- |
|
|
158
|
+
| 苹果系统默认浏览器 | `Safari` |
|
|
159
|
+
| 谷歌浏览器 | `Chrome` |
|
|
160
|
+
| 微软IE浏览器 | `IE` |
|
|
161
|
+
| 微软新一代浏览器 | `Edge` |
|
|
162
|
+
| 火狐浏览器 | `Firefox` |
|
|
163
|
+
| 火狐浏览器 | `Firefox Focus` |
|
|
164
|
+
| 谷歌浏览器开源版 | `Chromium` |
|
|
165
|
+
| Opera浏览器 | `Opera` |
|
|
166
|
+
| Opera联合创始人发布 | `Vivaldi` |
|
|
167
|
+
| 俄罗斯最大搜索引擎Yandex出品 | `Yandex` |
|
|
168
|
+
| 基于webkit和Qt的轻量级浏览器 | `Arora` |
|
|
169
|
+
| 来自日本的三引擎浏览器 | `Lunascape` |
|
|
170
|
+
| 轻量级跨平台浏览器 | `QupZilla` |
|
|
171
|
+
| 越南搜索引擎浏览器 | `Coc Coc` |
|
|
172
|
+
| 亚马逊电子书 | `Kindle` |
|
|
173
|
+
| Firefox浏览器的Debian再发布版 | `Iceweasel` |
|
|
174
|
+
| Konqueror | `Konqueror` |
|
|
175
|
+
| Iceape | `Iceape` |
|
|
176
|
+
| SeaMonkey | `SeaMonkey` |
|
|
177
|
+
| Epiphany | `Epiphany` |
|
|
178
|
+
| 360浏览器(手机版) | `360` |
|
|
179
|
+
| 360安全浏览器 | `360EE` |
|
|
180
|
+
| 360极速浏览器 | `360SE` |
|
|
181
|
+
| UC浏览器 | `UC` |
|
|
182
|
+
| QQ浏览器 | `QQBrowser` |
|
|
183
|
+
| QQ客户端 | `QQ` |
|
|
184
|
+
| 百度浏览器 | `Baidu` |
|
|
185
|
+
| 傲游浏览器 | `Maxthon` |
|
|
186
|
+
| 搜狗浏览器 | `Sogou` |
|
|
187
|
+
| 猎豹浏览器 | `Liebao` |
|
|
188
|
+
| 2345浏览器 | `2345Explorer` |
|
|
189
|
+
| 115浏览器 | `115Browser` |
|
|
190
|
+
| 世界之窗浏览器 | `TheWorld` |
|
|
191
|
+
| 小米浏览器 | `XiaoMi` |
|
|
192
|
+
| 夸克浏览器 | `Quark` |
|
|
193
|
+
| 旗鱼浏览器 | `Qiyu` |
|
|
194
|
+
| 微信手机客户端 | `Wechat` |
|
|
195
|
+
| 企业微信客户端 | `WechatWork` |
|
|
196
|
+
| 淘宝手机客户端 | `Taobao` |
|
|
197
|
+
| 支付宝手机客户端 | `Alipay` |
|
|
198
|
+
| 微博手机客户端 | `Weibo` |
|
|
199
|
+
| 豆瓣手机客户端 | `Douban` |
|
|
200
|
+
| 苏宁易购手机客户端 | `Suning` |
|
|
201
|
+
| 爱奇艺手机客户端 | `iQiYi` |
|
|
202
|
+
| 钉钉手机客户端 | `DingTalk` |
|
|
203
|
+
| 华为浏览器 | `Huawei` |
|
|
204
|
+
| Vivo浏览器 | `Vivo` |
|
|
205
|
+
| Firefox 下一代网络浏览器Nightly | `Firefox Nightly` |
|
|
206
|
+
| 微信小程序 | `Wechat Miniapp` |
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
if (process.env.ENV_NODE === 'production') {
|
|
4
|
-
module.exports = require('./dist/index.min.js')
|
|
5
|
-
} else {
|
|
6
|
-
module.exports = require('./dist/index.cjs.js')
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
if (process.env.ENV_NODE === 'production') {
|
|
4
|
+
module.exports = require('./dist/index.min.js')
|
|
5
|
+
} else {
|
|
6
|
+
module.exports = require('./dist/index.cjs.js')
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ua-browser",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "uaBrowser - 通过useragent和浏览器环境变量检测浏览器、系统及设备类型工具,支持node环境使用",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"module": "./dist/index.esm.mjs",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"require": "./dist/index.cjs.js",
|
|
11
|
-
"import": "./dist/index.esm.mjs",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "node build.js",
|
|
20
|
-
"dev": "node build.js --watch",
|
|
21
|
-
"test": "node example/index.js"
|
|
22
|
-
},
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/yangtianxia/ua-browser.git"
|
|
26
|
-
},
|
|
27
|
-
"keywords": [
|
|
28
|
-
"uaBrowser",
|
|
29
|
-
"userAgent",
|
|
30
|
-
"javascript",
|
|
31
|
-
"typescript"
|
|
32
|
-
],
|
|
33
|
-
"author": "yangtianxia",
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/yangtianxia/ua-browser/issues"
|
|
37
|
-
},
|
|
38
|
-
"homepage": "https://github.com/yangtianxia/ua-browser#readme",
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@babel/core": "^7.14.6",
|
|
41
|
-
"@babel/polyfill": "^7.12.1",
|
|
42
|
-
"@babel/preset-env": "^7.14.7",
|
|
43
|
-
"@rollup/plugin-babel": "^5.3.1",
|
|
44
|
-
"@rollup/plugin-commonjs": "^21.1.0",
|
|
45
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
46
|
-
"@rollup/plugin-node-resolve": "^13.2.1",
|
|
47
|
-
"@rollup/plugin-typescript": "^8.3.2",
|
|
48
|
-
"@types/node": "^17.0.25",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
50
|
-
"@typescript-eslint/parser": "^5.20.0",
|
|
51
|
-
"babel-preset-env": "^1.7.0",
|
|
52
|
-
"core-js": "^3.22.2",
|
|
53
|
-
"eslint": "^8.13.0",
|
|
54
|
-
"eslint-plugin-import": "^2.26.0",
|
|
55
|
-
"minimist": "^1.2.8",
|
|
56
|
-
"rollup": "^2.70.2",
|
|
57
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
58
|
-
"shelljs": "^0.8.5",
|
|
59
|
-
"shx": "^0.3.4",
|
|
60
|
-
"tslib": "^2.3.1",
|
|
61
|
-
"typescript": "^4.6.3"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ua-browser",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "uaBrowser - 通过useragent和浏览器环境变量检测浏览器、系统及设备类型工具,支持node环境使用",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "./dist/index.esm.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.cjs.js",
|
|
11
|
+
"import": "./dist/index.esm.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "node build.js",
|
|
20
|
+
"dev": "node build.js --watch",
|
|
21
|
+
"test": "node example/index.js"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/yangtianxia/ua-browser.git"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"uaBrowser",
|
|
29
|
+
"userAgent",
|
|
30
|
+
"javascript",
|
|
31
|
+
"typescript"
|
|
32
|
+
],
|
|
33
|
+
"author": "yangtianxia",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/yangtianxia/ua-browser/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/yangtianxia/ua-browser#readme",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@babel/core": "^7.14.6",
|
|
41
|
+
"@babel/polyfill": "^7.12.1",
|
|
42
|
+
"@babel/preset-env": "^7.14.7",
|
|
43
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
44
|
+
"@rollup/plugin-commonjs": "^21.1.0",
|
|
45
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
46
|
+
"@rollup/plugin-node-resolve": "^13.2.1",
|
|
47
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
48
|
+
"@types/node": "^17.0.25",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
51
|
+
"babel-preset-env": "^1.7.0",
|
|
52
|
+
"core-js": "^3.22.2",
|
|
53
|
+
"eslint": "^8.13.0",
|
|
54
|
+
"eslint-plugin-import": "^2.26.0",
|
|
55
|
+
"minimist": "^1.2.8",
|
|
56
|
+
"rollup": "^2.70.2",
|
|
57
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
58
|
+
"shelljs": "^0.8.5",
|
|
59
|
+
"shx": "^0.3.4",
|
|
60
|
+
"tslib": "^2.3.1",
|
|
61
|
+
"typescript": "^4.6.3"
|
|
62
|
+
}
|
|
63
|
+
}
|