Socket
Book a DemoInstallSign in
Socket

es-check-min

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-check-min

A CLI tool and library to find the minimum compatible ECMAScript version of a JavaScript file.

1.0.6
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

es-check-min

NPM Package es-check-min License: MIT

A CLI tool and library to find the minimum compatible ECMAScript version of a JavaScript file.

Overview

A simple tool built on es-check to find the lowest supported ECMAScript version of a JavaScript file.

The es-check-min tool does not require any arguments, and simply runs a loop to determine the file's lowest compatible ECMAScript version. This is in slight contrast to es-check which checks a file against a specified ECMAScript version.

Detection of the following ECMAScript versions is supported:

  • ES5
  • ES6 / ES2015
  • ES7 / ES2016
  • ES8 / ES2017
  • ES9 / ES2018
  • ES10 / ES2019
  • ES11 / ES2020
  • ES12 / ES2021
  • ES13 / ES2022

Note: The underlying es-check implementation technically supports ES3 and ES14 / ES2023, but certain tests aren't passing against these targets so they are not currently returned.

Getting started

Dependencies

The es-check-min CLI tool requires Node 20+. The exported APIs are ESM and share the Node 20+ requirement.

Installation

Invoke directly:

npx es-check-min

Or, install locally to access the CLI commands in a single project or to import the provided APIs:

npm install es-check-min

Or, install globally for access across your system:

npm install --global es-check-min

Usage

CLI

Example

es-check-min ./mystery-file.js

prints...

es6/es2015

Command

es-check-min <file>
Positional ArgumentDescriptionType
filePath to the JavaScript file to check.string
OptionAliasDescriptionType
--help-hShow helpboolean
--version-vShow version numberboolean

Library

A single function is exported:

function esCheckMin(path: string): Promise<EsVersion | undefined>

Background

Requests for something like this have come up once or twice:

Maintainers

@kitschpatrol

Acknowledgments

es-check-min is just a trivial wrapper over es-check. All credit goes to Jeff Wainwright and contributors for creating and maintaining es-check.

Contributing

Issues and pull requests are welcome.

License

MIT © Eric Mika

Keywords

es-check

FAQs

Package last updated on 04 Mar 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.