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 ๐Ÿ™

ยฉ 2025 โ€“ย Pkg Stats / Ryan Hefner

@sugarat/es-check

v0.1.2

Published

Check JavaScript&HTML files ES version against a specified ES version ๐Ÿ†

Downloads

14

Readme

@sugarat/es-check

Check JavaScript&HTML files ES version against a specified ES version ๐Ÿ†

reference es-check,but this is strong and friendly

Get Started

By CLI

npm i @sugarat/es-check --save-dev   # locally
npm i @sugarat/es-check -g           # or globally

Check if an array or glob of files matches a specified ES version.

  • Note: adds quotation around globs. Globs are patterns like so, <something>/*.js <something>/*.html.
escheck es5 testProject/**/*.js testProject/**/*.html

The ES Check script (above) checks testProject/**/*.js testProject/**/*.html files to see if they're ES5. It throws an error and logs files are that do not pass the check.

output terminal

ๅ›พ็‰‡

output log file

escheck es5 testProject/**/*.js testProject/**/*.html --out

ๅ›พ็‰‡

CLI Options

escheck --help
Usage: bin [options] [ecmaVersion] [files...]

Arguments:
  ecmaVersion            ecmaVersion to check files against. Can be: es3, es4, es5, es6/es2015, es7/es2016, es8/es2017, es9/es2018, es10/es2019 .etc
  files                  a glob of files to to test the EcmaScript version against(dist/**/*.js dist/**/*.html)

Options:
  -V, --version          output the version number
  -M,--module            use ES modules
  --allow-hash-bang      if the code starts with #! treat it as a comment
  -E,--exit-code <code>  with Error set process.exit(code)
  -O,--out [filename]    output error message to [filename] file
  -h, --help             display help for command

Local Lib

npm i @sugarat/es-check
# or
yarn add @sugarat/es-check
# or
pnpm add @sugarat/es-check

Usage

// ESM
import { checkCode, checkFile, checkHtmlCode } from '@sugarat/es-check'

// CJS
const { checkCode, checkFile, checkHtmlCode } = require('@sugarat/es-check')
checkCode(jsCode, defaultOptions)
checkHtmlCode(htmlCode, defaultOptions)
checkFile(filepath, defaultOptions)

example see test/util.test.ts

more utils see src/util/index.ts

Parser Options

interface ParserOptions {
  /**
   * @default '5'
   * 5|6|...|2015|2022|latest
   */
  ecmaVersion?: EcmaVersion
  /**
   * @default 'script'
   */
  sourceType?: 'module' | 'script'
  /**
   * @default false
   */
  allowHashBang?: boolean
}

More detail See es-check/src/types/index.ts