es-check-min
Version:
A CLI tool and library to find the minimum compatible ECMAScript version of a JavaScript file.
12 lines (10 loc) • 597 B
TypeScript
declare const esVersions: readonly ["es5", "es6/es2015", "es7/es2016", "es8/es2017", "es9/es2018", "es10/es2019", "es11/es2020", "es12/es2021", "es13/es2022"];
type EsVersion = (typeof esVersions)[number];
/**
* Get the minimum ECMAScript version required to run a file.
* @param path The path to the file to check, or a glob pattern of files.
* @returns The minimum ECMAScript version required to run the file, or `undefined` if the file is not valid ECMAScript.
*/
declare function esCheckMin(path: string): Promise<EsVersion | undefined>;
export { esCheckMin };
export type { EsVersion };