Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. # Browserslist [![Cult Of Martians][cult-img]][cult]
  2. <img width="120" height="120" alt="Browserslist logo by Anton Lovchikov"
  3. src="https://browserslist.github.io/browserslist/logo.svg" align="right">
  4. The config to share target browsers and Node.js versions between different
  5. front-end tools. It is used in:
  6. * [Autoprefixer]
  7. * [Babel]
  8. * [postcss-preset-env]
  9. * [eslint-plugin-compat]
  10. * [stylelint-no-unsupported-browser-features]
  11. * [postcss-normalize]
  12. * [obsolete-webpack-plugin]
  13. All tools will find target browsers automatically,
  14. when you add the following to `package.json`:
  15. ```json
  16. "browserslist": [
  17. "defaults",
  18. "not IE 11",
  19. "maintained node versions"
  20. ]
  21. ```
  22. Or in `.browserslistrc` config:
  23. ```yaml
  24. # Browsers that we support
  25. defaults
  26. not IE 11
  27. maintained node versions
  28. ```
  29. Developers set their version lists using queries like `last 2 versions`
  30. to be free from updating versions manually.
  31. Browserslist will use [`caniuse-lite`] with [Can I Use] data for this queries.
  32. Browserslist will take queries from tool option,
  33. `browserslist` config, `.browserslistrc` config,
  34. `browserslist` section in `package.json` or environment variables.
  35. [cult-img]: https://cultofmartians.com/assets/badges/badge.svg
  36. [cult]: https://cultofmartians.com/done.html
  37. <a href="https://evilmartians.com/?utm_source=browserslist">
  38. <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
  39. alt="Sponsored by Evil Martians" width="236" height="54">
  40. </a>
  41. [stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features
  42. [eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat
  43. [Browserslist Example]: https://github.com/browserslist/browserslist-example
  44. [postcss-preset-env]: https://github.com/jonathantneal/postcss-preset-env
  45. [postcss-normalize]: https://github.com/jonathantneal/postcss-normalize
  46. [`caniuse-lite`]: https://github.com/ben-eb/caniuse-lite
  47. [Autoprefixer]: https://github.com/postcss/autoprefixer
  48. [Can I Use]: https://caniuse.com/
  49. [Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
  50. [obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin
  51. ## Table of Contents
  52. * [Tools](#tools)
  53. * [Text Editors](#text-editors)
  54. * [Best Practices](#best-practices)
  55. * [Browsers Data Updating](#browsers-data-updating)
  56. * [Queries](#queries)
  57. * [Query Composition](#query-composition)
  58. * [Full List](#full-list)
  59. * [Debug](#debug)
  60. * [Browsers](#browsers)
  61. * [Config File](#config-file)
  62. * [`package.json`](#packagejson)
  63. * [`.browserslistrc`](#browserslistrc)
  64. * [Shareable Configs](#shareable-configs)
  65. * [Configuring for Different Environments](#configuring-for-different-environments)
  66. * [Custom Usage Data](#custom-usage-data)
  67. * [JS API](#js-api)
  68. * [Environment Variables](#environment-variables)
  69. * [Cache](#cache)
  70. * [Security Contact](#security-contact)
  71. * [For Enterprise](#for-enterprise)
  72. ## Tools
  73. * [`browserl.ist`](https://browserl.ist/) is an online tool to check
  74. what browsers will be selected by some query.
  75. * [`browserslist-ga`] and [`browserslist-ga-export`] download your website
  76. browsers statistics to use it in `> 0.5% in my stats` query.
  77. * [`browserslist-useragent-regexp`] compiles Browserslist query to a RegExp
  78. to test browser useragent.
  79. * [`browserslist-useragent-ruby`] is a Ruby library to checks browser
  80. by user agent string to match Browserslist.
  81. * [`browserslist-browserstack`] runs BrowserStack tests for all browsers
  82. in Browserslist config.
  83. * [`browserslist-adobe-analytics`] use Adobe Analytics data to target browsers.
  84. * [`caniuse-api`] returns browsers which support some specific feature.
  85. * Run `npx browserslist` in your project directory to see project’s
  86. target browsers. This CLI tool is built-in and available in any project
  87. with Autoprefixer.
  88. [`browserslist-useragent-regexp`]: https://github.com/browserslist/browserslist-useragent-regexp
  89. [`browserslist-adobe-analytics`]: https://github.com/xeroxinteractive/browserslist-adobe-analytics
  90. [`browserslist-useragent-ruby`]: https://github.com/browserslist/browserslist-useragent-ruby
  91. [`browserslist-browserstack`]: https://github.com/xeroxinteractive/browserslist-browserstack
  92. [`browserslist-ga-export`]: https://github.com/browserslist/browserslist-ga-export
  93. [`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
  94. [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
  95. [`caniuse-api`]: https://github.com/Nyalab/caniuse-api
  96. ### Text Editors
  97. These extensions will add syntax highlighting for `.browserslistrc` files.
  98. * [VS Code](https://marketplace.visualstudio.com/items?itemName=webben.browserslist)
  99. * [Vim](https://github.com/browserslist/vim-browserslist)
  100. ## Best Practices
  101. * There is a `defaults` query, which gives a reasonable configuration
  102. for most users:
  103. ```json
  104. "browserslist": [
  105. "defaults"
  106. ]
  107. ```
  108. * If you want to change the default set of browsers, we recommend combining
  109. `last 2 versions`, `not dead` with a usage number like `> 0.2%`. This is
  110. because `last n versions` on its own does not add popular old versions, while
  111. only using a percentage above `0.2%` will in the long run make popular
  112. browsers even more popular. We might run into a monopoly and stagnation
  113. situation, as we had with Internet Explorer 6. Please use this setting
  114. with caution.
  115. * Select browsers directly (`last 2 Chrome versions`) only if you are making
  116. a web app for a kiosk with one browser. There are a lot of browsers
  117. on the market. If you are making general web app you should respect
  118. browsers diversity.
  119. * Don’t remove browsers just because you don’t know them. Opera Mini has
  120. 100 million users in Africa and it is more popular in the global market
  121. than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
  122. and desktop Safari combined.
  123. ## Browsers Data Updating
  124. `npx browserslist@latest --update-db` updates `caniuse-lite` version
  125. in your npm, yarn or pnpm lock file.
  126. You need to do it regularly for two reasons:
  127. 1. To use the latest browser’s versions and statistics in queries like
  128. `last 2 versions` or `>1%`. For example, if you created your project
  129. 2 years ago and did not update your dependencies, `last 1 version`
  130. will return 2 year old browsers.
  131. 2. `caniuse-lite` deduplication: to synchronize version in different tools.
  132. > What is deduplication?
  133. Due to how npm architecture is setup, you may have a situation
  134. where you have multiple versions of a single dependency required.
  135. Imagine you begin a project, and you add `autoprefixer` as a dependency.
  136. npm looks for the latest `caniuse-lite` version (1.0.30000700) and adds it to
  137. `package-lock.json` under `autoprefixer` dependencies.
  138. A year later, you decide to add Babel. At this moment, we have a
  139. new version of `canuse-lite` (1.0.30000900). npm took the latest version
  140. and added it to your lock file under `@babel/preset-env` dependencies.
  141. Now your lock file looks like this:
  142. ```ocaml
  143. autoprefixer 7.1.4
  144. browserslist 3.1.1
  145. caniuse-lite 1.0.30000700
  146. @babel/preset-env 7.10.0
  147. browserslist 4.13.0
  148. caniuse-lite 1.0.30000900
  149. ```
  150. As you can see, we now have two versions of `caniuse-lite` installed.
  151. ## Queries
  152. Browserslist will use browsers and Node.js versions query
  153. from one of these sources:
  154. 1. `browserslist` key in `package.json` file in current or parent directories.
  155. **We recommend this way.**
  156. 2. `.browserslistrc` config file in current or parent directories.
  157. 3. `browserslist` config file in current or parent directories.
  158. 4. `BROWSERSLIST` environment variable.
  159. 5. If the above methods did not produce a valid result
  160. Browserslist will use defaults:
  161. `> 0.5%, last 2 versions, Firefox ESR, not dead`.
  162. ### Query Composition
  163. An `or` combiner can use the keyword `or` as well as `,`.
  164. `last 1 version or > 1%` is equal to `last 1 version, > 1%`.
  165. `and` query combinations are also supported to perform an
  166. intersection of all the previous queries:
  167. `last 1 version or chrome > 75 and > 1%` will select
  168. (`browser last version` or `Chrome since 76`) and `more than 1% marketshare`.
  169. There is 3 different ways to combine queries as depicted below. First you start
  170. with a single query and then we combine the queries to get our final list.
  171. Obviously you can *not* start with a `not` combiner, since there is no left-hand
  172. side query to combine it with. The left-hand is always resolved as `and`
  173. combiner even if `or` is used (this is an API implementation specificity).
  174. | Query combiner type | Illustration | Example |
  175. | ------------------- | :----------: | ------- |
  176. |`or`/`,` combiner <br> (union) | ![Union of queries](img/union.svg) | `> .5% or last 2 versions` <br> `> .5%, last 2 versions` |
  177. | `and` combiner <br> (intersection) | ![intersection of queries](img/intersection.svg) | `> .5% and last 2 versions` |
  178. | `not` combiner <br> (relative complement) | ![Relative complement of queries](img/complement.svg) | All those three are equivalent to the first one <br> `> .5% and not last 2 versions` <br> `> .5% or not last 2 versions` <br> `> .5%, not last 2 versions` |
  179. _A quick way to test your query is to do `npx browserslist '> 0.5%, not IE 11'`
  180. in your terminal._
  181. ### Full List
  182. You can specify the browser and Node.js versions by queries (case insensitive):
  183. * `defaults`: Browserslist’s default browsers
  184. (`> 0.5%, last 2 versions, Firefox ESR, not dead`).
  185. * `> 5%`: browsers versions selected by global usage statistics.
  186. `>=`, `<` and `<=` work too.
  187. * `> 5% in US`: uses USA usage statistics.
  188. It accepts [two-letter country code].
  189. * `> 5% in alt-AS`: uses Asia region usage statistics.
  190. List of all region codes can be found at [`caniuse-lite/data/regions`].
  191. * `> 5% in my stats`: uses [custom usage data].
  192. * `> 5% in browserslist-config-mycompany stats`: uses [custom usage data]
  193. from `browserslist-config-mycompany/browserslist-stats.json`.
  194. * `cover 99.5%`: most popular browsers that provide coverage.
  195. * `cover 99.5% in US`: same as above, with [two-letter country code].
  196. * `cover 99.5% in my stats`: uses [custom usage data].
  197. * `dead`: browsers without official support or updates for 24 months.
  198. Right now it is `IE 10`, `IE_Mob 11`, `BlackBerry 10`, `BlackBerry 7`,
  199. `Samsung 4` and `OperaMobile 12.1`.
  200. * `last 2 versions`: the last 2 versions for *each* browser.
  201. * `last 2 Chrome versions`: the last 2 versions of Chrome browser.
  202. * `last 2 major versions` or `last 2 iOS major versions`:
  203. all minor/patch releases of last 2 major versions.
  204. * `node 10` and `node 10.4`: selects latest Node.js `10.x.x`
  205. or `10.4.x` release.
  206. * `current node`: Node.js version used by Browserslist right now.
  207. * `maintained node versions`: all Node.js versions, which are [still maintained]
  208. by Node.js Foundation.
  209. * `iOS 7`: the iOS browser version 7 directly.
  210. * `Firefox > 20`: versions of Firefox newer than 20.
  211. `>=`, `<` and `<=` work too. It also works with Node.js.
  212. * `ie 6-8`: selects an inclusive range of versions.
  213. * `Firefox ESR`: the latest [Firefox Extended Support Release].
  214. * `PhantomJS 2.1` and `PhantomJS 1.9`: selects Safari versions similar
  215. to PhantomJS runtime.
  216. * `extends browserslist-config-mycompany`: take queries from
  217. `browserslist-config-mycompany` npm package.
  218. * `supports es6-module`: browsers with support for specific features.
  219. `es6-module` here is the `feat` parameter at the URL of the [Can I Use]
  220. page. A list of all available features can be found at
  221. [`caniuse-lite/data/features`].
  222. * `browserslist config`: the browsers defined in Browserslist config. Useful
  223. in Differential Serving to modify user’s config like
  224. `browserslist config and supports es6-module`.
  225. * `since 2015` or `last 2 years`: all versions released since year 2015
  226. (also `since 2015-03` and `since 2015-03-10`).
  227. * `unreleased versions` or `unreleased Chrome versions`:
  228. alpha and beta versions.
  229. * `not ie <= 8`: exclude IE 8 and lower from previous queries.
  230. You can add `not ` to any query.
  231. [`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions
  232. [`caniuse-lite/data/features`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/features
  233. [two-letter country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
  234. [custom usage data]: #custom-usage-data
  235. [still maintained]: https://github.com/nodejs/Release
  236. [Can I Use]: https://caniuse.com/
  237. [Firefox Extended Support Release]: https://support.mozilla.org/en-US/kb/choosing-firefox-update-channel
  238. ### Debug
  239. Run `npx browserslist` in project directory to see what browsers was selected
  240. by your queries.
  241. ```sh
  242. $ npx browserslist
  243. and_chr 61
  244. and_ff 56
  245. and_qq 1.2
  246. and_uc 11.4
  247. android 56
  248. baidu 7.12
  249. bb 10
  250. chrome 62
  251. edge 16
  252. firefox 56
  253. ios_saf 11
  254. opera 48
  255. safari 11
  256. samsung 5
  257. ```
  258. ### Browsers
  259. Names are case insensitive:
  260. * `Android` for Android WebView.
  261. * `Baidu` for Baidu Browser.
  262. * `BlackBerry` or `bb` for Blackberry browser.
  263. * `Chrome` for Google Chrome.
  264. * `ChromeAndroid` or `and_chr` for Chrome for Android
  265. * `Edge` for Microsoft Edge.
  266. * `Electron` for Electron framework. It will be converted to Chrome version.
  267. * `Explorer` or `ie` for Internet Explorer.
  268. * `ExplorerMobile` or `ie_mob` for Internet Explorer Mobile.
  269. * `Firefox` or `ff` for Mozilla Firefox.
  270. * `FirefoxAndroid` or `and_ff` for Firefox for Android.
  271. * `iOS` or `ios_saf` for iOS Safari.
  272. * `Node` for Node.js.
  273. * `Opera` for Opera.
  274. * `OperaMini` or `op_mini` for Opera Mini.
  275. * `OperaMobile` or `op_mob` for Opera Mobile.
  276. * `QQAndroid` or `and_qq` for QQ Browser for Android.
  277. * `Safari` for desktop Safari.
  278. * `Samsung` for Samsung Internet.
  279. * `UCAndroid` or `and_uc` for UC Browser for Android.
  280. * `kaios` for KaiOS Browser.
  281. ## Config File
  282. ### `package.json`
  283. If you want to reduce config files in project root, you can specify
  284. browsers in `package.json` with `browserslist` key:
  285. ```json
  286. {
  287. "private": true,
  288. "dependencies": {
  289. "autoprefixer": "^6.5.4"
  290. },
  291. "browserslist": [
  292. "last 1 version",
  293. "> 1%",
  294. "IE 10"
  295. ]
  296. }
  297. ```
  298. ### `.browserslistrc`
  299. Separated Browserslist config should be named `.browserslistrc`
  300. and have browsers queries split by a new line.
  301. Each line is combined with the `or` combiner. Comments starts with `#` symbol:
  302. ```yaml
  303. # Browsers that we support
  304. last 1 version
  305. > 1%
  306. IE 10 # sorry
  307. ```
  308. Browserslist will check config in every directory in `path`.
  309. So, if tool process `app/styles/main.css`, you can put config to root,
  310. `app/` or `app/styles`.
  311. You can specify direct path in `BROWSERSLIST_CONFIG` environment variables.
  312. ## Shareable Configs
  313. You can use the following query to reference an exported Browserslist config
  314. from another package:
  315. ```json
  316. "browserslist": [
  317. "extends browserslist-config-mycompany"
  318. ]
  319. ```
  320. For security reasons, external configuration only supports packages that have
  321. the `browserslist-config-` prefix. npm scoped packages are also supported, by
  322. naming or prefixing the module with `@scope/browserslist-config`, such as
  323. `@scope/browserslist-config` or `@scope/browserslist-config-mycompany`.
  324. If you don’t accept Browserslist queries from users, you can disable the
  325. validation by using the or `BROWSERSLIST_DANGEROUS_EXTEND` environment variable.
  326. ```sh
  327. BROWSERSLIST_DANGEROUS_EXTEND=1 npx webpack
  328. ```
  329. Because this uses `npm`'s resolution, you can also reference specific files
  330. in a package:
  331. ```json
  332. "browserslist": [
  333. "extends browserslist-config-mycompany/desktop",
  334. "extends browserslist-config-mycompany/mobile"
  335. ]
  336. ```
  337. When writing a shared Browserslist package, just export an array.
  338. `browserslist-config-mycompany/index.js`:
  339. ```js
  340. module.exports = [
  341. 'last 1 version',
  342. '> 1%',
  343. 'ie 10'
  344. ]
  345. ```
  346. You can also include a `browserslist-stats.json` file as part of your shareable
  347. config at the root and query it using
  348. `> 5% in browserslist-config-mycompany stats`. It uses the same format
  349. as `extends` and the `dangerousExtend` property as above.
  350. You can export configs for different environments and select environment
  351. by `BROWSERSLIST_ENV` or `env` option in your tool:
  352. ```js
  353. module.exports = {
  354. development: [
  355. 'last 1 version'
  356. ],
  357. production: [
  358. 'last 1 version',
  359. '> 1%',
  360. 'ie 10'
  361. ]
  362. }
  363. ```
  364. ## Configuring for Different Environments
  365. You can also specify different browser queries for various environments.
  366. Browserslist will choose query according to `BROWSERSLIST_ENV` or `NODE_ENV`
  367. variables. If none of them is declared, Browserslist will firstly look
  368. for `production` queries and then use defaults.
  369. In `package.json`:
  370. ```js
  371. "browserslist": {
  372. "production": [
  373. "> 1%",
  374. "ie 10"
  375. ],
  376. "modern": [
  377. "last 1 chrome version",
  378. "last 1 firefox version"
  379. ],
  380. "ssr": [
  381. "node 12"
  382. ]
  383. }
  384. ```
  385. In `.browserslistrc` config:
  386. ```ini
  387. [production]
  388. > 1%
  389. ie 10
  390. [modern]
  391. last 1 chrome version
  392. last 1 firefox version
  393. [ssr]
  394. node 12
  395. ```
  396. ## Custom Usage Data
  397. If you have a website, you can query against the usage statistics of your site.
  398. [`browserslist-ga`] will ask access to Google Analytics and then generate
  399. `browserslist-stats.json`:
  400. ```
  401. npx browserslist-ga
  402. ```
  403. Or you can use [`browserslist-ga-export`] to convert Google Analytics data without giving a password for Google account.
  404. You can generate usage statistics file by any other method. File format should
  405. be like:
  406. ```js
  407. {
  408. "ie": {
  409. "6": 0.01,
  410. "7": 0.4,
  411. "8": 1.5
  412. },
  413. "chrome": {
  414. },
  415. }
  416. ```
  417. Note that you can query against your custom usage data while also querying
  418. against global or regional data. For example, the query
  419. `> 1% in my stats, > 5% in US, 10%` is permitted.
  420. [`browserslist-ga-export`]: https://github.com/browserslist/browserslist-ga-export
  421. [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
  422. [Can I Use]: https://caniuse.com/
  423. ## JS API
  424. ```js
  425. const browserslist = require('browserslist')
  426. // Your CSS/JS build tool code
  427. function process (source, opts) {
  428. const browsers = browserslist(opts.overrideBrowserslist, {
  429. stats: opts.stats,
  430. path: opts.file,
  431. env: opts.env
  432. })
  433. // Your code to add features for selected browsers
  434. }
  435. ```
  436. Queries can be a string `"> 1%, IE 10"`
  437. or an array `['> 1%', 'IE 10']`.
  438. If a query is missing, Browserslist will look for a config file.
  439. You can provide a `path` option (that can be a file) to find the config file
  440. relatively to it.
  441. Options:
  442. * `path`: file or a directory path to look for config file. Default is `.`.
  443. * `env`: what environment section use from config. Default is `production`.
  444. * `stats`: custom usage statistics data.
  445. * `config`: path to config if you want to set it manually.
  446. * `ignoreUnknownVersions`: do not throw on direct query (like `ie 12`).
  447. Default is `false`.
  448. * `dangerousExtend`: Disable security checks for `extend` query.
  449. Default is `false`.
  450. * `mobileToDesktop`: Use desktop browsers if Can I Use doesn’t have data
  451. about this mobile version. For instance, Browserslist will return
  452. `chrome 20` on `and_chr 20` query (Can I Use has only data only about
  453. latest versions of mobile browsers). Default is `false`.
  454. For non-JS environment and debug purpose you can use CLI tool:
  455. ```sh
  456. browserslist "> 1%, IE 10"
  457. ```
  458. You can get total users coverage for selected browsers by JS API:
  459. ```js
  460. browserslist.coverage(browserslist('> 1%'))
  461. //=> 81.4
  462. ```
  463. ```js
  464. browserslist.coverage(browserslist('> 1% in US'), 'US')
  465. //=> 83.1
  466. ```
  467. ```js
  468. browserslist.coverage(browserslist('> 1% in my stats'), 'my stats')
  469. //=> 83.1
  470. ```
  471. ```js
  472. browserslist.coverage(browserslist('> 1% in my stats', { stats }), stats)
  473. //=> 82.2
  474. ```
  475. Or by CLI:
  476. ```sh
  477. $ browserslist --coverage "> 1%"
  478. These browsers account for 81.4% of all users globally
  479. ```
  480. ```sh
  481. $ browserslist --coverage=US "> 1% in US"
  482. These browsers account for 83.1% of all users in the US
  483. ```
  484. ```sh
  485. $ browserslist --coverage "> 1% in my stats"
  486. These browsers account for 83.1% of all users in custom statistics
  487. ```
  488. ```sh
  489. $ browserslist --coverage "> 1% in my stats" --stats=./stats.json
  490. These browsers account for 83.1% of all users in custom statistics
  491. ```
  492. ## Environment Variables
  493. If a tool uses Browserslist inside, you can change the Browserslist settings
  494. with [environment variables]:
  495. * `BROWSERSLIST` with browsers queries.
  496. ```sh
  497. BROWSERSLIST="> 5%" npx webpack
  498. ```
  499. * `BROWSERSLIST_CONFIG` with path to config file.
  500. ```sh
  501. BROWSERSLIST_CONFIG=./config/browserslist npx webpack
  502. ```
  503. * `BROWSERSLIST_ENV` with environments string.
  504. ```sh
  505. BROWSERSLIST_ENV="development" npx webpack
  506. ```
  507. * `BROWSERSLIST_STATS` with path to the custom usage data
  508. for `> 1% in my stats` query.
  509. ```sh
  510. BROWSERSLIST_STATS=./config/usage_data.json npx webpack
  511. ```
  512. * `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache.
  513. ```sh
  514. BROWSERSLIST_DISABLE_CACHE=1 npx webpack
  515. ```
  516. * `BROWSERSLIST_DANGEROUS_EXTEND` to disable security shareable config
  517. name check.
  518. ```sh
  519. BROWSERSLIST_DANGEROUS_EXTEND=1 npx webpack
  520. ```
  521. [environment variables]: https://en.wikipedia.org/wiki/Environment_variable
  522. ## Cache
  523. Browserslist caches the configuration it reads from `package.json` and
  524. `browserslist` files, as well as knowledge about the existence of files,
  525. for the duration of the hosting process.
  526. To clear these caches, use:
  527. ```js
  528. browserslist.clearCaches()
  529. ```
  530. To disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE`
  531. environment variable.
  532. ## Security Contact
  533. To report a security vulnerability, please use the [Tidelift security contact].
  534. Tidelift will coordinate the fix and disclosure.
  535. [Tidelift security contact]: https://tidelift.com/security
  536. ## For Enterprise
  537. Available as part of the Tidelift Subscription.
  538. The maintainers of `browserslist` and thousands of other packages are working
  539. with Tidelift to deliver commercial support and maintenance for the open source
  540. dependencies you use to build your applications. Save time, reduce risk,
  541. and improve code health, while paying the maintainers of the exact dependencies
  542. you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-browserslist?utm_source=npm-browserslist&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)