Registry / devops / esmon
library2.0.1jsnpmunverified

A fast file-watching runner and build tool for scripts, powered by esbuild. Version 2.0.1 uses esbuild for rapid compilation and restarting, with automatic dependency tracking, external module exclusion, and optional ESM output. It supports TypeScript decorators via swc and runs multiple commands (watch, run, build). Maintained by egoist, with regular updates. Differentiators: leverages esbuild's speed, built-in build command, and automatic watch of imported files.

npm install esmon
INSTALL
IMPORT
SIG · ESMON
E
esmon
devopsjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

esmon (CLI)
npx esmon your-script.ts
npm start esmon your-script.ts
esmon is primarily a CLI tool, not a library.
run
esmon run your-script.ts
esmon your-script.ts (without run flag runs watch mode)
The default command is watch; use 'run' to execute without watching.
build
esmon build your-script.ts
esmon build your-script.ts --format esm (flag is --esm)
Use --esm for ESM output, not --format esm.

Install esmon as a dev dependency and run a TypeScript script with file watching.

npm i -D esmon esmon your-script.ts
esmon --version
Debug
Known issues
gotchaTemporary files are emitted to ./temp folder; add to .gitignore.
fix
Add 'temp/' to your .gitignore file.
affects: >=2.0.0
gotchaDefault command watches files; use 'run' to execute once.
fix
Run 'esmon run your-script.ts' instead of 'esmon your-script.ts'.
affects: >=2.0.0
gotchaESM output uses --esm flag, not --format esm.
fix
Use 'esmon build --esm your-script.ts'.
affects: >=2.0.0
gotchaDecorators require emitDecoratorMetadata in tsconfig.json; uses swc.
fix
Enable emitDecoratorMetadata in tsconfig.json.
affects: >=2.0.0
gotchadevDependencies excluded by default; use --bundleDevDeps to include.
fix
Pass --bundleDevDeps flag to include devDependencies in bundle.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild'
esbuild is not installed or not in node_modules.
fix
Run 'npm install esbuild' or add it as a dependency.
Command not found: esmon
esmon is not installed globally or locally.
fix
Run 'npm install -D esmon' in your project directory.
TypeError: __dirname is not defined
Using CommonJS __dirname in ESM output.
fix
Use --esm flag or import.meta.url for ESM.
Error: Decorator metadata not supported
emitDecoratorMetadata not enabled in tsconfig.json.
fix
Set 'emitDecoratorMetadata': true in tsconfig.json compilerOptions.
Build failed: Unexpected token
Incompatible JavaScript/TypeScript syntax with esbuild.
fix
Ensure your code uses supported syntax; update esbuild version.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
esmon — npm install esmon · libregistry