🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

check-ecmascript-version-compatibility

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-ecmascript-version-compatibility

Test files for ECMAScript version compatibility.

0.2.0
latest
Source
npm
Version published
Weekly downloads
79
17.91%
Maintainers
2
Weekly downloads
 
Created
Source

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);
  });
});

Keywords

es5

FAQs

Package last updated on 04 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts