browserslist-to-es-version
v1.0.0
Published
Convert [browserslist](https://github.com/browserslist/browserslist) query to ECMAScript version.
Downloads
19,821
Readme
browserslist-to-es-version
Convert browserslist query to ECMAScript version.
Usage
Install:
npm add browserslist-to-es-version -D
Example:
import {browserslistToESVersion} from 'browserslist-to-es-version';
const esVersion = browserslistToESVersion([
"chrome >= 87",
"edge >= 88",
"firefox >= 78",
"safari >= 14",
]);
console.log(esVersion); // 2017
Type
// Only supports ES5 ~ ES2018
type ESVersion = 5 | 2015 | 2016 | 2017 | 2018;
function browserslistToESVersion(browsers: string[]): ESVersion;
License
MIT.