Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
35
decreased by-50.7%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc