.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / caniuse-lite / README.md
1 # caniuse-lite
2
3 > A smaller version of caniuse-db, with only the essentials!
4
5 ## Why?
6
7 The full data behind [Can I use][1] is incredibly useful for any front end
8 developer, and on the website all of the details from the database are displayed
9 to the user. However in automated tools, [many of these fields go unused][2];
10 it's not a problem for server side consumption but client side, the less
11 JavaScript that we send to the end user the better.
12
13 caniuse-lite then, is a smaller dataset that keeps essential parts of the data
14 in a compact format. It does this in multiple ways, such as converting `null`
15 array entries into empty strings, representing support data as an integer rather
16 than a string, and using base62 references instead of longer human-readable
17 keys.
18
19 This packed data is then reassembled (via functions exposed by this module) into
20 a larger format which is mostly compatible with caniuse-db, and so it can be
21 used as an almost drop-in replacement for caniuse-db for contexts where size on
22 disk is important; for example, usage in web browsers. The API differences are
23 very small and are detailed in the section below.
24
25
26 ## API
27
28 ```js
29 import * as lite from 'caniuse-lite';
30 ```
31
32 ### `lite.agents`
33
34 caniuse-db provides a full `data.json` file which contains all of the features
35 data. Instead of this large file, caniuse-lite provides this data subset
36 instead, which has the `browser`, `prefix`, `prefix_exceptions`, `usage_global`
37 and `versions` keys from the original.
38
39 In addition, the subset contains the `release_date` key with release dates (as timestamps) for each version:
40 ```json
41 {
42   "release_date": {
43     "6": 998870400,
44     "7": 1161129600,
45     "8": 1237420800,
46     "9": 1300060800,
47     "10": 1346716800,
48     "11": 1381968000,
49     "5.5": 962323200
50   }
51 }
52 ```
53
54 ### `lite.feature(js)`
55
56 The `feature` method takes a file from `data/features` and converts it into
57 something that more closely represents the `caniuse-db` format. Note that only
58 the `title`, `stats` and `status` keys are kept from the original data.
59
60 ### `lite.features`
61
62 The `features` index is provided as a way to query all of the features that
63 are listed in the `caniuse-db` dataset. Note that you will need to use the
64 `feature` method on values from this index to get a human-readable format.
65
66 ### `lite.region(js)`
67
68 The `region` method takes a file from `data/regions` and converts it into
69 something that more closely represents the `caniuse-db` format. Note that *only*
70 the usage data is exposed here (the `data` key in the original files).
71
72
73 ## Contributors
74
75 Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
76
77 <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
78 <!-- prettier-ignore -->
79 | [<img src="https://avatars.githubusercontent.com/u/1282980?v=3" width="100px;"/><br /><sub><b>Ben Briggs</b></sub>](http://beneb.info)<br />[💻](https://github.com/ben-eb/caniuse-lite/commits?author=ben-eb "Code") [📖](https://github.com/ben-eb/caniuse-lite/commits?author=ben-eb "Documentation") [👀](#review-ben-eb "Reviewed Pull Requests") [⚠️](https://github.com/ben-eb/caniuse-lite/commits?author=ben-eb "Tests") | [<img src="https://avatars.githubusercontent.com/u/1737375?v=3" width="100px;"/><br /><sub><b>Andy Jansson</b></sub>](https://github.com/andyjansson)<br />[💻](https://github.com/ben-eb/caniuse-lite/commits?author=andyjansson "Code") | [<img src="https://avatars1.githubusercontent.com/u/19343?v=4" width="100px;"/><br /><sub><b>Andrey Sitnik</b></sub>](http://twitter.com/sitnikcode)<br />[💻](https://github.com/ben-eb/caniuse-lite/commits?author=ai "Code") | <img src="https://avatars2.githubusercontent.com/u/947326?v=4" width="100px;"/><br /><sub><b>Igor Deryabin</b></sub><br />[💻](https://github.com/ben-eb/caniuse-lite/commits?author=rodweb "Code") |
80 | :---: | :---: | :---: | :---: |
81 <!-- ALL-CONTRIBUTORS-LIST:END -->
82
83 This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
84
85 <img src="https://opensource.nyc3.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_icon_blue.svg" alt="Digital Ocean logo" width="40" align="left">
86
87 Big thanks to [DigitalOcean](https://www.digitalocean.com/?utm_source=opensource&utm_campaign=caniuse-lite) for supporting this project by providing their great infrastructure for us.
88
89 ## License
90
91 The data in this repo is available for use under a CC BY 4.0 license
92 (http://creativecommons.org/licenses/by/4.0/). For attribution just mention
93 somewhere that the source is caniuse.com. If you have any questions about using
94 the data for your project please contact me here: http://a.deveria.com/contact
95
96 [1]: http://caniuse.com/
97 [2]: https://github.com/Fyrd/caniuse/issues/1827
98
99 ## Security contact information
100
101 To report a security vulnerability, please use the
102 [Tidelift security contact](https://tidelift.com/security).
103 Tidelift will coordinate the fix and disclosure.