1
0
Fork
You've already forked check-ecmascript-version-compatibility
0
test files for ES5 compatibility
  • JavaScript 100%
2026年06月12日 12:53:36 -05:00
test-fixtures Stop running test fixtures as tests 2026年06月12日 12:50:57 -05:00
.gitignore Initial commit 2017年02月17日 14:25:54 -08:00
.prettierrc.json Update Prettier 2025年11月16日 20:08:45 +00:00
check-ecmascript-version-compatibility.js Minor: remove a newline 2026年06月12日 12:49:59 -05:00
eslint.config.mjs Update ESLint 2025年11月16日 20:10:32 +00:00
LICENSE Update license year for 2026 2026年06月12日 12:51:58 -05:00
package-lock.json Switch to detect-es-version 2026年06月12日 12:46:43 -05:00
package.json Switch to Codeberg 2026年06月12日 12:53:36 -05:00
README.md Use ESLint + Prettier instead of Standard 2023年03月04日 21:17:46 +00:00
test.js Tweak variable name of test fixture 2026年06月12日 12:51:39 -05:00

Check ECMAScript Version Compatibility

A small lib that helps check and make sure that your JavaScript will run in chosen ES version environment (defaults to ES5).

Install

npm install --save-dev check-ecmascript-version-compatibility

Usage

Here's an example that uses Mocha:

var checkFile = require("check-ecmascript-version-compatibility");
describe("my file", function () {
 it("is ES2016-compliant", function (done) {
 // It can take awhile to parse large files, so you may need to
 // increase your timeouts.
 this.slow(8000);
 this.timeout(10000);
 checkFile("path/to/file.js", 2016, done);
 });
});

If you do not pass in a version number, it will default to ES5.

describe("my file", function () {
 it("is ES5-compliant", function (done) {
 // It can take awhile to parse large files, so you may need to
 // increase your timeouts.
 this.slow(8000);
 this.timeout(10000);
 checkFile("path/to/file.js", done);
 });
});