Socket
Book a DemoInstallSign in
Socket

check-es-version

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-es-version

A tool used to check the ECMAScript compatibility of JavaScript packages.

1.5.1
latest
Source
npmnpm
Version published
Weekly downloads
17
466.67%
Maintainers
1
Weekly downloads
 
Created
Source

check-es-version

A tool used to check the ECMAScript compatibility of a JavaScript package and all its dependencies recursively.

Installation

yarn add --dev check-es-version

Usage

check-es-version --es-version=<esVersion> \
  --package-name=<packageName> \
  --require-resolve-path=<requireResolvePath> \
  --show-dependency-tree=<showDependencyTree> \
  --show-error=<showError> \
  --check-peer-dependency=<checkPeerDependency> \
  [--target-file=<targetFile>] \
  [--target-dir=<targetDir>]

where

  • --es-version=<esVersion> or -e <esVersion>: The ECMAScript compatibility version to check. Default value is 5.
  • --package-name=<packageName> or -p <packageName>: The name of the package to check. Default value is ., indicating the package in the current directory.
  • --require-resolve-path=<requireResolvePath> or -r <requireResolvePath>: The path where to resolve the dependent packages. Default value is ., indicating the program will try to resolve the path of the dependent packages in the ./node_modules directory.
  • --show-dependency-tree=<showDependencyTree> or -t <showDependencyTree>: Whether to display the dependency tree. Default value is false. If the project has a very deep dependency tree, display the dependency tree may cause an unreadable output.
  • --show-error=<showError> or -s <showError>: Whether to display the detailed parsing errors of each incompatible packages. Default value is false.
  • --check-peer-dependency=<checkPeerDependency> or -c <checkPeerDependency>: Whether to check the peerDependencies of the packages. Default value is false.
  • --target-file=<targetFile> or -f <targetFile>: If this argument is specified, the program will only check the compatibility of the specified file.
  • --target-dir=<targetDir> or -d <targetDir>: If this argument is specified, the program will check the compatibility of the all JavaScript files in the specified directory.
  • --help or -h: Show the command line help messages.

Examples

First execute the following command to install the package:

yarn add --dev check-es-version

Then add the following command in the package.json:

"scripts": {
  ...
  "es5": "./node_modules/.bin/check-es-version -e 5 -p .",
  ...
}

Now you can use yarn es5 to check the ES5 compatibility of your library and all its dependencies.

If you project is not a library, for example, a Quasar App. You can add the following command to your package.json:

"scripts": {
  ...
  "es5": "./node_modules/.bin/check-es-version -e 5 -d ./dist/spa/js/",
  "es5:dep": "./node_modules/.bin/check-es-version -e 5 -p .",
  ...
}

The first command yarn es5 will check the compatibility of all compilied JavaScript files of your App. If you find some JS file is incompatible, you can execute the second command yarn es5:dep to check the compatibility of all dependencies of your App. If you find some dependency is incompatible to ES5, you can add it to the build.transpileDependencies option of quasar.conf.js.

Keywords

ECMASCript

FAQs

Package last updated on 07 Jan 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.