Import Upstream version 1.3.21

parents
v1.3.0
* Additionally include chromium to electron mappings
v1.2.0
* versions and full-versions are now separately importable.
v1.1.0
* Both electronToChromium and electronToBrowserList now can accept strings as well as numbers.
v1.0.1
Update documentation
v1.0.0
Inititial release
# 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)
This repository provides a mapping of Electron versions to the Chromium version that it uses.
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).
## Install
Install using `npm install electron-to-chromium`.
## Usage
To include Electron-to-Chromium, require it:
```js
var e2c = require('electron-to-chromium');
```
### Properties
The Electron-to-Chromium object has 4 properties to use:
#### `versions`
An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value.
```js
var versions = e2c.versions;
console.log(versions['1.4']);
// returns "53"
```
#### `fullVersions`
An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value.
```js
var versions = e2c.fullVersions;
console.log(versions['1.4.11']);
// returns "53.0.2785.143"
```
#### `chromiumVersions`
An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value.
```js
var versions = e2c.chromiumVersions;
console.log(versions['54']);
// returns "1.4"
```
#### `fullChromiumVersions`
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.
```js
var versions = e2c.fullChromiumVersions;
console.log(versions['54.0.2840.101']);
// returns ["1.5.1", "1.5.0"]
```
### Functions
#### `electronToChromium(query)`
Arguments:
* Query: string or number, required. A major or full Electron version.
A function that returns the corresponding Chromium version for a given Electron function. Returns a string.
If you provide it with a major Electron version, it will return a major Chromium version:
```js
var chromeVersion = e2c.electronToChromium('1.4');
// chromeVersion is "53"
```
If you provide it with a full Electron version, it will return the full Chromium version.
```js
var chromeVersion = e2c.electronToChromium('1.4.11');
// chromeVersion is "53.0.2785.143"
```
If a query does not match a Chromium version, it will return `undefined`.
```js
var chromeVersion = e2c.electronToChromium('9000');
// chromeVersion is undefined
```
#### `chromiumToElectron(query)`
Arguments:
* Query: string or number, required. A major or full Chromium version.
Returns a string with the corresponding Electron version for a given Chromium query.
If you provide it with a major Chromium version, it will return a major Electron version:
```js
var electronVersion = e2c.chromiumToElectron('54');
// electronVersion is "1.4"
```
If you provide it with a full Chrome version, it will return an array of full Electron versions.
```js
var electronVersions = e2c.chromiumToElectron('56.0.2924.87');
// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"]
```
If a query does not match an Electron version, it will return `undefined`.
```js
var electronVersion = e2c.chromiumToElectron('10');
// chromeVersion is undefined
```
#### `electronToBrowserList(query)` **DEPRECATED**
Arguments:
* Query: string or number, required. A major Electron version.
_**Deprecated**: Browserlist already includes electron-to-chromium._
A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string.
If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities:
```js
var query = e2c.electronToBrowserList('1.4');
// query is "Chrome >= 53"
```
If a query does not match a Chromium version, it will return `undefined`.
```js
var query = e2c.electronToBrowserList('9000');
// query is undefined
```
### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions
All lists can be imported on their own, if file size is a concern.
#### `versions`
```js
var versions = require('electron-to-chromium/versions');
```
#### `fullVersions`
```js
var fullVersions = require('electron-to-chromium/full-versions');
```
#### `chromiumVersions`
```js
var chromiumVersions = require('electron-to-chromium/chromium-versions');
```
#### `fullChromiumVersions`
```js
var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions');
```
## Updating
This package will be updated with each new Electron release.
To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions.
To verify correct behaviour, run `npm test`.
module.exports = {
"39": "0.20",
"40": "0.21",
"41": "0.21",
"42": "0.25",
"43": "0.27",
"44": "0.30",
"45": "0.31",
"47": "0.36",
"49": "0.37",
"50": "1.1",
"51": "1.2",
"52": "1.3",
"53": "1.4",
"54": "1.4",
"56": "1.6",
"58": "1.7",
"59": "1.8"
};
\ No newline at end of file
module.exports = {
"56.0.2924.87": [
"1.6.13",
"1.6.12",
"1.6.11",
"1.6.10",
"1.6.9",
"1.6.8",
"1.6.7",
"1.6.6",
"1.6.5",
"1.6.4",
"1.6.3",
"1.6.2",
"1.6.1",
"1.6.0"
],
"59.0.3071.115": [
"1.8.0"
],
"58.0.3029.110": [
"1.7.7",
"1.7.6",
"1.7.5",
"1.7.4",
"1.7.3",
"1.7.2",
"1.7.1",
"1.7.0"
],
"52.0.2743.82": [
"1.3.15",
"1.3.14",
"1.3.13",
"1.3.10",
"1.3.9",
"1.3.7",
"1.3.6",
"1.3.5",
"1.3.4",
"1.3.3",
"1.3.2",
"1.3.1",
"1.3.0"
],
"53.0.2785.143": [
"1.4.16",
"1.4.15",
"1.4.14",
"1.4.13",
"1.4.11",
"1.4.10",
"1.4.9",
"1.4.8",
"1.4.7",
"1.4.6"
],
"54.0.2840.101": [
"1.5.1",
"1.5.0"
],
"54.0.2840.51": [
"1.4.12"
],
"53.0.2785.113": [
"1.4.5",
"1.4.4",
"1.4.3",
"1.4.2",
"1.4.1",
"1.4.0"
],
"51.0.2704.106": [
"1.2.8",
"1.2.7",
"1.2.6"
],
"51.0.2704.103": [
"1.2.5",
"1.2.4"
],
"51.0.2704.84": [
"1.2.3",
"1.2.2"
],
"51.0.2704.63": [
"1.2.1",
"1.2.0"
],
"50.0.2661.102": [
"1.1.3",
"1.1.2",
"1.1.1",
"1.1.0"
],
"49.0.2623.75": [
"1.0.2",
"1.0.1",
"1.0.0",
"0.37.8",
"0.37.7",
"0.37.6",
"0.37.5",
"0.37.4",
"0.37.3",
"0.37.1",
"0.37.0"
],
"47.0.2526.110": [
"0.36.12",
"0.36.11",
"0.36.10",
"0.36.9",
"0.36.8",
"0.36.7",
"0.36.6",
"0.36.5"
],
"47.0.2526.73": [
"0.36.4",
"0.36.3",
"0.36.2",
"0.36.0"
],
"45.0.2454.85": [
"0.35.5",
"0.35.4",
"0.35.3",
"0.35.2",
"0.34.4",
"0.35.1",
"0.34.3",
"0.34.2",
"0.34.1",
"0.34.0",
"0.33.9",
"0.33.8",
"0.33.7",
"0.33.6",
"0.33.4",
"0.33.3",
"0.33.2",
"0.33.1",
"0.33.0",
"0.32.3",
"0.32.2",
"0.31.2"
],
"44.0.2403.125": [
"0.31.0",
"0.30.4"
],
"43.0.2357.65": [
"0.29.2",
"0.29.1",
"0.28.3",
"0.28.2",
"0.28.1",
"0.28.0",
"0.27.3",
"0.27.2"
],
"42.0.2311.107": [
"0.27.1",
"0.27.0",
"0.26.1",
"0.26.0",
"0.25.3",
"0.25.2",
"0.25.1",
"0.25.0"
],
"41.0.2272.76": [
"0.24.0",
"0.23.0",
"0.22.3",
"0.22.2",
"0.22.1",
"0.21.3"
],
"40.0.2214.91": [
"0.21.2",
"0.21.1",
"0.21.0"
],
"39.0.2171.65": [
"0.20.8",
"0.20.7",
"0.20.6",
"0.20.5",
"0.20.4",
"0.20.3",
"0.20.2",
"0.20.1",
"0.20.0"
]
};
\ No newline at end of file
module.exports = {
"1.6.13": "56.0.2924.87",
"1.8.0": "59.0.3071.115",
"1.7.7": "58.0.3029.110",
"1.7.6": "58.0.3029.110",
"1.6.12": "56.0.2924.87",
"1.7.5": "58.0.3029.110",
"1.7.4": "58.0.3029.110",
"1.7.3": "58.0.3029.110",
"1.7.2": "58.0.3029.110",
"1.6.11": "56.0.2924.87",
"1.7.1": "58.0.3029.110",
"1.6.10": "56.0.2924.87",
"1.7.0": "58.0.3029.110",
"1.6.9": "56.0.2924.87",
"1.6.8": "56.0.2924.87",
"1.3.15": "52.0.2743.82",
"1.6.7": "56.0.2924.87",
"1.6.6": "56.0.2924.87",
"1.4.16": "53.0.2785.143",
"1.6.5": "56.0.2924.87",
"1.6.4": "56.0.2924.87",
"1.3.14": "52.0.2743.82",
"1.6.3": "56.0.2924.87",
"1.6.2": "56.0.2924.87",
"1.6.1": "56.0.2924.87",
"1.6.0": "56.0.2924.87",
"1.5.1": "54.0.2840.101",
"1.5.0": "54.0.2840.101",
"1.4.15": "53.0.2785.143",
"1.4.14": "53.0.2785.143",
"1.4.13": "53.0.2785.143",
"1.4.12": "54.0.2840.51",
"1.4.11": "53.0.2785.143",
"1.3.13": "52.0.2743.82",
"1.4.10": "53.0.2785.143",
"1.4.9": "53.0.2785.143",
"1.4.8": "53.0.2785.143",
"1.3.10": "52.0.2743.82",
"1.3.9": "52.0.2743.82",
"1.4.7": "53.0.2785.143",
"1.4.6": "53.0.2785.143",
"1.4.5": "53.0.2785.113",
"1.4.4": "53.0.2785.113",
"1.4.3": "53.0.2785.113",
"1.4.2": "53.0.2785.113",
"1.3.7": "52.0.2743.82",
"1.4.1": "53.0.2785.113",
"1.4.0": "53.0.2785.113",
"1.3.6": "52.0.2743.82",
"1.3.5": "52.0.2743.82",
"1.3.4": "52.0.2743.82",
"1.3.3": "52.0.2743.82",
"1.3.2": "52.0.2743.82",
"1.3.1": "52.0.2743.82",
"1.3.0": "52.0.2743.82",
"1.2.8": "51.0.2704.106",
"1.2.7": "51.0.2704.106",
"1.2.6": "51.0.2704.106",
"1.2.5": "51.0.2704.103",
"1.2.4": "51.0.2704.103",
"1.2.3": "51.0.2704.84",
"1.2.2": "51.0.2704.84",
"1.2.1": "51.0.2704.63",
"1.2.0": "51.0.2704.63",
"1.1.3": "50.0.2661.102",
"1.1.2": "50.0.2661.102",
"1.1.1": "50.0.2661.102",
"1.1.0": "50.0.2661.102",
"1.0.2": "49.0.2623.75",
"1.0.1": "49.0.2623.75",
"1.0.0": "49.0.2623.75",
"0.37.8": "49.0.2623.75",
"0.37.7": "49.0.2623.75",
"0.37.6": "49.0.2623.75",
"0.37.5": "49.0.2623.75",
"0.37.4": "49.0.2623.75",
"0.37.3": "49.0.2623.75",
"0.36.12": "47.0.2526.110",
"0.37.1": "49.0.2623.75",
"0.37.0": "49.0.2623.75",
"0.36.11": "47.0.2526.110",
"0.36.10": "47.0.2526.110",
"0.36.9": "47.0.2526.110",
"0.36.8": "47.0.2526.110",
"0.36.7": "47.0.2526.110",
"0.36.6": "47.0.2526.110",
"0.36.5": "47.0.2526.110",
"0.36.4": "47.0.2526.73",
"0.36.3": "47.0.2526.73",
"0.35.5": "45.0.2454.85",
"0.36.2": "47.0.2526.73",
"0.36.0": "47.0.2526.73",
"0.35.4": "45.0.2454.85",
"0.35.3": "45.0.2454.85",
"0.35.2": "45.0.2454.85",
"0.34.4": "45.0.2454.85",
"0.35.1": "45.0.2454.85",
"0.34.3": "45.0.2454.85",
"0.34.2": "45.0.2454.85",
"0.34.1": "45.0.2454.85",
"0.34.0": "45.0.2454.85",
"0.33.9": "45.0.2454.85",
"0.33.8": "45.0.2454.85",
"0.33.7": "45.0.2454.85",
"0.33.6": "45.0.2454.85",
"0.33.4": "45.0.2454.85",
"0.33.3": "45.0.2454.85",
"0.33.2": "45.0.2454.85",
"0.33.1": "45.0.2454.85",
"0.33.0": "45.0.2454.85",
"0.32.3": "45.0.2454.85",
"0.32.2": "45.0.2454.85",
"0.31.2": "45.0.2454.85",
"0.31.0": "44.0.2403.125",
"0.30.4": "44.0.2403.125",
"0.29.2": "43.0.2357.65",
"0.29.1": "43.0.2357.65",
"0.28.3": "43.0.2357.65",
"0.28.2": "43.0.2357.65",
"0.28.1": "43.0.2357.65",
"0.28.0": "43.0.2357.65",
"0.27.3": "43.0.2357.65",
"0.27.2": "43.0.2357.65",
"0.27.1": "42.0.2311.107",
"0.27.0": "42.0.2311.107",
"0.26.1": "42.0.2311.107",
"0.26.0": "42.0.2311.107",
"0.25.3": "42.0.2311.107",
"0.25.2": "42.0.2311.107",
"0.25.1": "42.0.2311.107",
"0.25.0": "42.0.2311.107",
"0.24.0": "41.0.2272.76",
"0.23.0": "41.0.2272.76",
"0.22.3": "41.0.2272.76",
"0.22.2": "41.0.2272.76",
"0.22.1": "41.0.2272.76",
"0.21.3": "41.0.2272.76",
"0.21.2": "40.0.2214.91",
"0.21.1": "40.0.2214.91",
"0.21.0": "40.0.2214.91",
"0.20.8": "39.0.2171.65",
"0.20.7": "39.0.2171.65",
"0.20.6": "39.0.2171.65",
"0.20.5": "39.0.2171.65",
"0.20.4": "39.0.2171.65",
"0.20.3": "39.0.2171.65",
"0.20.2": "39.0.2171.65",
"0.20.1": "39.0.2171.65",
"0.20.0": "39.0.2171.65"
};
\ No newline at end of file
var versions = require('./versions');
var fullVersions = require('./full-versions');
var chromiumVersions = require('./chromium-versions');
var fullChromiumVersions = require('./full-chromium-versions');
var electronToChromium = function (query) {
var number = getQueryString(query);
return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined;
};
var chromiumToElectron = function (query) {
var number = getQueryString(query);
return number.split('.').length > 2 ? fullChromiumVersions[number] : chromiumVersions[number] || undefined;
};
var electronToBrowserList = function (query) {
var number = getQueryString(query);
return versions[number] ? "Chrome >= " + versions[number] : undefined;
};
var getQueryString = function (query) {
var number = query;
if (query === 1) { number = "1.0" }
if (typeof query === 'number') { number += ''; }
return number;
};
module.exports = {
versions: versions,
fullVersions: fullVersions,
chromiumVersions: chromiumVersions,
fullChromiumVersions: fullChromiumVersions,
electronToChromium: electronToChromium,
electronToBrowserList: electronToBrowserList,
chromiumToElectron: chromiumToElectron
};
{
"name": "electron-to-chromium",
"version": "1.3.21",
"description": "Provides a list of electron-to-chromium version mappings",
"main": "index.js",
"files": [
"versions.js",
"full-versions.js",
"chromium-versions.js",
"full-chromium-versions.js"
],
"scripts": {
"build": "node build.js",
"update": "node automated-update.js",
"test": "nyc ava --verbose",
"report": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
},
"repository": {
"type": "git",
"url": "https://github.com/kilian/electron-to-chromium/"
},
"keywords": [
"electron",
"chrome",
"browserlist"
],
"author": "Kilian Valkhof",
"license": "ISC",
"devDependencies": {
"ava": "^0.18.2",
"codecov": "^2.1.0",
"nyc": "^10.2.0",
"request": "^2.79.0",
"shelljs": "^0.7.6"
}
}
module.exports = {
"1.6": "56",
"1.8": "59",
"1.7": "58",
"1.3": "52",
"1.4": "53",
"1.5": "54",
"1.2": "51",
"1.1": "50",
"1.0": "49",
"0.37": "49",
"0.36": "47",
"0.35": "45",
"0.34": "45",
"0.33": "45",
"0.32": "45",
"0.31": "44",
"0.30": "44",
"0.29": "43",
"0.28": "43",
"0.27": "42",
"0.26": "42",
"0.25": "42",
"0.24": "41",
"0.23": "41",
"0.22": "41",
"0.21": "40",
"0.20": "39"
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment