source: trip-planner-front/node_modules/electron-to-chromium/README.md@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 6.3 KB
Line 
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)[![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)
12
13This repository provides a mapping of Electron versions to the Chromium version that it uses.
14
15This 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).
16
17**Supported by:**
18
19 <a href="https://m.do.co/c/bb22ea58e765">
20 <img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
21 </a>
22
23
24## Install
25Install using `npm install electron-to-chromium`.
26
27## Usage
28To include Electron-to-Chromium, require it:
29
30```js
31var e2c = require('electron-to-chromium');
32```
33
34### Properties
35The Electron-to-Chromium object has 4 properties to use:
36
37#### `versions`
38An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value.
39
40```js
41var versions = e2c.versions;
42console.log(versions['1.4']);
43// returns "53"
44```
45
46#### `fullVersions`
47An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value.
48
49```js
50var versions = e2c.fullVersions;
51console.log(versions['1.4.11']);
52// returns "53.0.2785.143"
53```
54
55#### `chromiumVersions`
56An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value.
57
58```js
59var versions = e2c.chromiumVersions;
60console.log(versions['54']);
61// returns "1.4"
62```
63
64#### `fullChromiumVersions`
65An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value.
66
67```js
68var versions = e2c.fullChromiumVersions;
69console.log(versions['54.0.2840.101']);
70// returns ["1.5.1", "1.5.0"]
71```
72### Functions
73
74#### `electronToChromium(query)`
75Arguments:
76* Query: string or number, required. A major or full Electron version.
77
78A function that returns the corresponding Chromium version for a given Electron function. Returns a string.
79
80If you provide it with a major Electron version, it will return a major Chromium version:
81
82```js
83var chromeVersion = e2c.electronToChromium('1.4');
84// chromeVersion is "53"
85```
86
87If you provide it with a full Electron version, it will return the full Chromium version.
88
89```js
90var chromeVersion = e2c.electronToChromium('1.4.11');
91// chromeVersion is "53.0.2785.143"
92```
93
94If a query does not match a Chromium version, it will return `undefined`.
95
96```js
97var chromeVersion = e2c.electronToChromium('9000');
98// chromeVersion is undefined
99```
100
101#### `chromiumToElectron(query)`
102Arguments:
103* Query: string or number, required. A major or full Chromium version.
104
105Returns a string with the corresponding Electron version for a given Chromium query.
106
107If you provide it with a major Chromium version, it will return a major Electron version:
108
109```js
110var electronVersion = e2c.chromiumToElectron('54');
111// electronVersion is "1.4"
112```
113
114If you provide it with a full Chrome version, it will return an array of full Electron versions.
115
116```js
117var electronVersions = e2c.chromiumToElectron('56.0.2924.87');
118// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"]
119```
120
121If a query does not match an Electron version, it will return `undefined`.
122
123```js
124var electronVersion = e2c.chromiumToElectron('10');
125// electronVersion is undefined
126```
127
128#### `electronToBrowserList(query)` **DEPRECATED**
129Arguments:
130* Query: string or number, required. A major Electron version.
131
132_**Deprecated**: Browserlist already includes electron-to-chromium._
133
134A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string.
135
136If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities:
137
138```js
139var query = e2c.electronToBrowserList('1.4');
140// query is "Chrome >= 53"
141```
142
143If a query does not match a Chromium version, it will return `undefined`.
144
145```js
146var query = e2c.electronToBrowserList('9000');
147// query is undefined
148```
149
150### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions
151All lists can be imported on their own, if file size is a concern.
152
153#### `versions`
154
155```js
156var versions = require('electron-to-chromium/versions');
157```
158
159#### `fullVersions`
160
161```js
162var fullVersions = require('electron-to-chromium/full-versions');
163```
164
165#### `chromiumVersions`
166
167```js
168var chromiumVersions = require('electron-to-chromium/chromium-versions');
169```
170
171#### `fullChromiumVersions`
172
173```js
174var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions');
175```
176
177## Updating
178This package will be updated with each new Electron release.
179
180To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions.
181
182To verify correct behaviour, run `npm test`.
183
184
185## License
186[![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)
Note: See TracBrowser for help on using the repository browser.