{"id":25544,"library":"esmon","title":"esmon","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install esmon","lang":"bash","label":"npm"},{"cmd":"yarn add esmon","lang":"bash","label":"yarn"},{"cmd":"pnpm add esmon","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"esmon is primarily a CLI tool, not a library.","wrong":"npm start esmon your-script.ts","symbol":"esmon (CLI)","correct":"npx esmon your-script.ts"},{"note":"The default command is watch; use 'run' to execute without watching.","wrong":"esmon your-script.ts (without run flag runs watch mode)","symbol":"run","correct":"esmon run your-script.ts"},{"note":"Use --esm for ESM output, not --format esm.","wrong":"esmon build your-script.ts --format esm (flag is --esm)","symbol":"build","correct":"esmon build your-script.ts"}],"quickstart":{"code":"npm i -D esmon\nesmon your-script.ts","lang":"typescript","description":"Install esmon as a dev dependency and run a TypeScript script with file watching."},"warnings":[{"fix":"Add 'temp/' to your .gitignore file.","message":"Temporary files are emitted to ./temp folder; add to .gitignore.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Run 'esmon run your-script.ts' instead of 'esmon your-script.ts'.","message":"Default command watches files; use 'run' to execute once.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use 'esmon build --esm your-script.ts'.","message":"ESM output uses --esm flag, not --format esm.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Enable emitDecoratorMetadata in tsconfig.json.","message":"Decorators require emitDecoratorMetadata in tsconfig.json; uses swc.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Pass --bundleDevDeps flag to include devDependencies in bundle.","message":"devDependencies excluded by default; use --bundleDevDeps to include.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install esbuild' or add it as a dependency.","cause":"esbuild is not installed or not in node_modules.","error":"Error: Cannot find module 'esbuild'"},{"fix":"Run 'npm install -D esmon' in your project directory.","cause":"esmon is not installed globally or locally.","error":"Command not found: esmon"},{"fix":"Use --esm flag or import.meta.url for ESM.","cause":"Using CommonJS __dirname in ESM output.","error":"TypeError: __dirname is not defined"},{"fix":"Set 'emitDecoratorMetadata': true in tsconfig.json compilerOptions.","cause":"emitDecoratorMetadata not enabled in tsconfig.json.","error":"Error: Decorator metadata not supported"},{"fix":"Ensure your code uses supported syntax; update esbuild version.","cause":"Incompatible JavaScript/TypeScript syntax with esbuild.","error":"Build failed: Unexpected token"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}