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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vanillaes/esmtk

v1.1.1

Published

ES Module Toolkit

Readme

Commands

  • init - Create a package.json file for ECMAScript module development
  • test - Run tests (using Tape-ES)
  • lint - Lint the source code (using Lint-ES)
  • type - Type check the JSDoc typings (using Typescript)
  • bundle - Bundle the source code to an ECMAScript module (using ESBuild)
  • minify - Bundle and Minify the source code to an ECMAScript module (using ESBuild)
  • commonjs - Bundle the source code to a CommonJS module (using ESBuild)
  • typings - Generate Type Declarations (.d.ts) from JSDoc (using Typescript)
  • clean - Clean up build artifacts
  • preview - Preview the package contents included during npm publish
  • cp - A cross-platform clone of the cp command in Linux
  • rm - A cross-platform clone of the rm command in Linux

Init

Create a package.json file for ECMAScript module development

Arguments

esmtk init [...options]

  • --scripts - Include ESMTK scripts

Usage

# init package.json
npx @vanillaes/esmtk init

# init package.json (including ESMTK scripts)
npx @vanillaes/esmtk init --scripts

Test

Run tests (using Tape-ES)

Arguments

esmtk test [...options] [glob]

  • [glob] - the glob used to locate test files (default: **/*.spec.js)
  • --ignore - the ignore matcher pattern (default **/node_modules/**)
  • --cwd - the current working directory (default process.cwd())
  • --watch - watch for changes to the tests

Usage

# run the tests
npx @vanillaes/esmtk test

# run the tests (using a different naming scheme)
npx @vanillaes/esmtk test **/*.test.js

# run the tests (ignore tests)
npx @vanillaes/esmtk test **/*.test.js --ignore **/node_modules/**,src/rm.spec.js

# run the tests (change the current working directory)
npx @vanillaes/esmtk test **/*.test.js --cwd src/

# run the tests (watch for changes)
npx @vanillaes/esmtk test --watch

Lint

Lint the source code (using Lint-ES)

Arguments

esmtk lint [...options]

  • --fix - automatically fix problems

Usage

# lint the sources
esmtk lint

# lint the sources and attempt to automatally fix the issues
esmtk --fix lint

Type

Type check the JSDoc typings (using Typescript)

Arguments

esmtk type [...options] [entry]

  • [entry] - the entry-point for the source
  • --strict - enable 'strict mode' type checks

Usage

# type check the sources
esmtk type index.js

# type check the sources (with 'strict mode' enabled)
esmtk type --strict index.js

Node: Due to Typescript limitations, inline JSDoc typings will be ignored if typings (ie *.d.ts files) exist.

Bundle

Bundle the source code to an ECMAScript module (using ESBuild)

Arguments

esmtk bundle [...options] [input] [output]

  • [input] - the input source file path
  • [output] - the output bundle file path
  • --platform=<platform> - target a specific platform (ex 'node')

Usage

# bundle ESM source -> ESM bundle
esmtk bundle src/sample.js bundle.js

# bundle ESM source -> ESM bundle (includes Node-specific bindings)
esmtk bundle --platform=node src/sample.js bundle.js

Minify

Bundle and Minify the source code to an ECMAScript module (using ESBuild)

Arguments

esmtk minify [...options] [input] [output]

  • [input] - the input source file path
  • [output] - the output bundle file path
  • --platform=<platform> - target a specific platform (ex 'node')
  • --sourcemap - generate a source map for the minified bundle

Usage

# bundle ESM source -> minified ESM bundle
esmtk minify src/sample.js bundle.min.js

# bundle ESM source -> minified ESM bundle (includes Node-specific bindings)
esmtk minify --platform=node src/sample.js bundle.min.js

# bundle ESM source -> minified ESM bundle (output a sourcemap)
esmtk minify --sourcemap src/sample.js bundle.min.js

CommonJS

Bundle the source code to a CommonJS module (using ESBuild)

Arguments

esmtk commonjs [...options] [input] [output]

  • [input] - the input source file path
  • [output] - the output bundle file path
  • --platform=<platform> - target a specific platform (ex 'node')

Usage

# bundle ESM source -> CommonJS bundle
esmtk commonjs src/sample.js bundle.cjs

# bundle ESM source -> CommonJS bundle (includes Node-specific bindings)
esmtk commonjs --platform=node src/sample.js bundle.cjs

Typings

Generate Type Declarations (.d.ts) from JSDoc (using Typescript)

Arguments

esmtk typings [entry]

  • [entry] - the entry-point for the source

Usage

# generate .d.ts files for all linked source files
esmtk typings index.js

Clean

Clean up build artifacts

Arguments

esmtk clean [...options] [cwd]

  • [cwd] - the current working directory (default: process.cwd())
  • --bundle - Clean bundled build artifacts (default: **/*.esm.js)
  • --minify - Clean minified build artifacts (default: **/*.min.js)
  • --typings - Clean typing artifacts (default: **/*.d.ts)
  • --custom - Clean based on a user-defined pattern

Usage

# clean all build artifacts
esmtk clean --bundle --minify --typings

# override default extension
esmtk clean --bundle *.mjs

# define your own pattern
esmtk clean --custom *.scss.css

Node: The clean command automatically ignores the contents of node_modules/

Preview

Preview the package contents included during npm publish

Arguments

esmtk preview [...options]

  • --cwd - the current working directory

Usage

# preview the package contents
esmtk preview

# preview the package contents (from another directory)
esmtk preview --cwd some/other/dir

CP

A cross-platform clone of the cp command in Linux

Arguments

esmtk cp [...options] [source...] [destination]

  • [source(s)...] - the source file(s)/glob(s)
  • [destination] - the destination file/directory
  • -r, --recursive - copy files/directories recursively

Usage

# copy one file
esmtk cp file1.txt dest/file1.txt

# copy multiple files
esmtk cp file1.txt file2.txt file3.txt dest/

# copy files that match a glob
esmtk cp *.txt dest/

# copy files that match multiple globs
esmtk cp *.txt *.js *.ts dest/

# recursively copy files from one directory to another
esmtk cp -r src/ dest/

RM

A cross-platform clone of the rm command in Linux

Arguments

esmtk rm [...options] [path(s)...]

  • [path(s)...] - the source file(s)/glob(s)
  • -r, --recursive - remove directory recursively

Usage

# remove one file
esmtk rm file1.txt

# remove multiple files
esmtk rm file1.txt file3.txt file3.txt

# remove files that match a glob
esmtk rm *.txt

# remove files that match miltiple globs
esmtk rm *.txt *.js *.ts

# recursively remove a 
esmtk rm -r src/