Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / electron-to-chromium / README.md
1 ### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof)
2
3 #### Other projects:
4
5 - 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once
6 - 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website
7 - 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad
8
9 ---
10
11 # Electron-to-Chromium [![npm](https://img.shields.io/npm/v/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![travis](https://img.shields.io/travis/Kilian/electron-to-chromium/master.svg)](https://travis-ci.org/Kilian/electron-to-chromium) [![npm-downloads](https://img.shields.io/npm/dm/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![codecov](https://codecov.io/gh/Kilian/electron-to-chromium/branch/master/graph/badge.svg)](https://codecov.io/gh/Kilian/electron-to-chromium)
12 [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield)
13
14 This repository provides a mapping of Electron versions to the Chromium version that it uses.
15
16 This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat).
17
18 ## Install
19 Install using `npm install electron-to-chromium`.
20
21 ## Usage
22 To include Electron-to-Chromium, require it:
23
24 ```js
25 var e2c = require('electron-to-chromium');
26 ```
27
28 ### Properties
29 The Electron-to-Chromium object has 4 properties to use:
30
31 #### `versions`
32 An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value.
33
34 ```js
35 var versions = e2c.versions;
36 console.log(versions['1.4']);
37 // returns "53"
38 ```
39
40 #### `fullVersions`
41 An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value.
42
43 ```js
44 var versions = e2c.fullVersions;
45 console.log(versions['1.4.11']);
46 // returns "53.0.2785.143"
47 ```
48
49 #### `chromiumVersions`
50 An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value.
51
52 ```js
53 var versions = e2c.chromiumVersions;
54 console.log(versions['54']);
55 // returns "1.4"
56 ```
57
58 #### `fullChromiumVersions`
59 An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value.
60
61 ```js
62 var versions = e2c.fullChromiumVersions;
63 console.log(versions['54.0.2840.101']);
64 // returns ["1.5.1", "1.5.0"]
65 ```
66 ### Functions
67
68 #### `electronToChromium(query)`
69 Arguments:
70 * Query: string or number, required. A major or full Electron version.
71
72 A function that returns the corresponding Chromium version for a given Electron function. Returns a string.
73
74 If you provide it with a major Electron version, it will return a major Chromium version:
75
76 ```js
77 var chromeVersion = e2c.electronToChromium('1.4');
78 // chromeVersion is "53"
79 ```
80
81 If you provide it with a full Electron version, it will return the full Chromium version.
82
83 ```js
84 var chromeVersion = e2c.electronToChromium('1.4.11');
85 // chromeVersion is "53.0.2785.143"
86 ```
87
88 If a query does not match a Chromium version, it will return `undefined`.
89
90 ```js
91 var chromeVersion = e2c.electronToChromium('9000');
92 // chromeVersion is undefined
93 ```
94
95 #### `chromiumToElectron(query)`
96 Arguments:
97 * Query: string or number, required. A major or full Chromium version.
98
99 Returns a string with the corresponding Electron version for a given Chromium query.
100
101 If you provide it with a major Chromium version, it will return a major Electron version:
102
103 ```js
104 var electronVersion = e2c.chromiumToElectron('54');
105 // electronVersion is "1.4"
106 ```
107
108 If you provide it with a full Chrome version, it will return an array of full Electron versions.
109
110 ```js
111 var electronVersions = e2c.chromiumToElectron('56.0.2924.87');
112 // electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"]
113 ```
114
115 If a query does not match an Electron version, it will return `undefined`.
116
117 ```js
118 var electronVersion = e2c.chromiumToElectron('10');
119 // chromeVersion is undefined
120 ```
121
122 #### `electronToBrowserList(query)` **DEPRECATED**
123 Arguments:
124 * Query: string or number, required. A major Electron version.
125
126 _**Deprecated**: Browserlist already includes electron-to-chromium._
127
128 A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string.
129
130 If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities:
131
132 ```js
133 var query = e2c.electronToBrowserList('1.4');
134 // query is "Chrome >= 53"
135 ```
136
137 If a query does not match a Chromium version, it will return `undefined`.
138
139 ```js
140 var query = e2c.electronToBrowserList('9000');
141 // query is undefined
142 ```
143
144 ### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions
145 All lists can be imported on their own, if file size is a concern.
146
147 #### `versions`
148
149 ```js
150 var versions = require('electron-to-chromium/versions');
151 ```
152
153 #### `fullVersions`
154
155 ```js
156 var fullVersions = require('electron-to-chromium/full-versions');
157 ```
158
159 #### `chromiumVersions`
160
161 ```js
162 var chromiumVersions = require('electron-to-chromium/chromium-versions');
163 ```
164
165 #### `fullChromiumVersions`
166
167 ```js
168 var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions');
169 ```
170
171 ## Updating
172 This package will be updated with each new Electron release.
173
174 To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions.
175
176 To verify correct behaviour, run `npm test`.
177
178
179 ## License
180 [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large)