npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

es-check-min

v1.0.4

Published

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

Downloads

12

Readme

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 lowest supported 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 Argument | Description | Type | | ------------------- | ------------------------------------- | -------- | | file | Path to the JavaScript file to check. | string |

| Option | Alias | Description | Type | | ----------- | ----- | ------------------- | --------- | | --help | -h | Show help | boolean | | --version | -v | Show version number | boolean |

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