electron-to-chromium

Other projects:

  • 💻 Polypane - Develop responsive websites and apps twice as fast on multiple screens at once

  • 🖌️ Superposition - Kickstart your design system by extracting design tokens from your website

  • 🗒️ FromScratch - A smart but simple autosaving scratchpad


Electron-to-Chromium npm travis npm-downloads codecovFOSSA Status

This repository provides a mapping of Electron versions to the Chromium version that it uses.

This package is used in Browserslist, so you can use e.g. electron >= 1.4 in Autoprefixer, Stylelint, babel-preset-env and eslint-plugin-compat.

Supported by:

Install

Install using npm install electron-to-chromium.

Usage

To include Electron-to-Chromium, require it:

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.

fullVersions

An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value.

chromiumVersions

An object of key-value pairs with a major Chromium version as the key, and the corresponding major Electron version as the value.

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.

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:

If you provide it with a full Electron version, it will return the full Chromium version.

If a query does not match a Chromium version, it will return 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:

If you provide it with a full Chrome version, it will return an array of full Electron versions.

If a query does not match an Electron version, it will return 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 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:

If a query does not match a Chromium version, it will return undefined.

Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions

All lists can be imported on their own, if file size is a concern.

versions

fullVersions

chromiumVersions

fullChromiumVersions

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.

License

FOSSA Status

Last updated

Was this helpful?