Registry / devops / esbuild-runner-plugins

esbuild-runner-plugins

JSON →
library2.3.0-plugins.0jsnpmunverified

esbuild-runner (esr) is a high-speed on-the-fly transpiler for modern JavaScript, TypeScript, and JSX, powered by esbuild. It replaces slower alternatives like ts-node and babel-register for running scripts, tests, or arbitrary code without pre-building. Current version is 2.3.0-plugins.0, built on esbuild (peer dependency of any version). It offers two modes: bundling (default, one-shot esbuild invocation) and transform (file-by-file with caching via --cache flag). Useful for development workflows, Jest transforms, and VSCode debugging. Ships TypeScript definitions. No built-in plugins; the 'plugins' suffix indicates compatibility with esbuild plugins.

npm install esbuild-runner-plugins
INSTALL
IMPORT
SIG · ESBUILD-RUNNER-PLU
E
esbuild-runner-plugins
devopsjavascriptv2.3.0-plugins.0
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.

esr
npx esr script.ts
esr script.ts (if not installed globally)
esr is a CLI binary; import is not applicable. Use npx or globally install.
register
require('esbuild-runner/register')
import 'esbuild-runner/register'
CommonJS only; no ESM equivalent. Use with node -r or runtime require.
jest transform
transform: { '\.ts$': 'esbuild-runner/jest' }
transform: { '\.ts$': 'esbuild-runner' }
Must specify /jest subpath in Jest config.
esbuild runner config
module.exports = { type: 'transform', esbuild: { target: 'esnext' } }
export default { ... }
Config file uses CommonJS, not ES modules.

Shows CLI and programmatic usage with TypeScript, including esr binary and require hook.

// Install locally npm add --dev esbuild-runner esbuild // Create a TypeScript file: hello.ts export function greet(name: string): string { return `Hello, ${name}!`; } // Run it with esr (no build step) esr -e 'console.log(greet("World"))' hello.ts // Or use register for REPL or scripts node -r esbuild-runner/register -e "const { greet } = require('./hello'); console.log(greet('World'));"
esr --version
Debug
Known issues
gotchaesbuild-runner does not transpile node_modules by default; if a dependency uses unsupported JS features, it may fail at runtime.
fix
Configure esbuild options in esbuild-runner.config.js to adjust target or include specific modules.
affects: >=1.0.0
gotchaThe 'plugins' version suffix (e.g., 2.3.0-plugins.0) may cause confusion with regular esbuild-runner; plugins are not included, only the runner.
fix
Use standard esbuild-runner (non-plugins) unless you specifically need compatibility with esbuild plugins.
affects: 2.3.0-plugins.0
deprecatedThe --cache flag is not stable and may be removed in future versions.
fix
Use bundle mode (default) for best performance; avoid relying on transform cache.
affects: >=2.0.0
gotchaesbuild-runner does not support all Node.js features; notably, 'import()' with CJS modules may not work as expected.
fix
Use esbuild's supported syntax or consider alternative runners like tsx.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-runner/register'
Package not installed or installed incorrectly.
fix
npm install --save-dev esbuild-runner
TypeError: esbuild is not a function
Missing esbuild peer dependency.
fix
npm install --save-dev esbuild
Error: Must use import to load ES Module: esbuild-runner/register
Trying to require an ESM-only package; register is CJS only.
fix
Use require() instead of import, or use -r flag with node.
SyntaxError: Unexpected token 'export'
esbuild-runner not registered or misconfigured.
fix
Run with -r esbuild-runner/register or use esr binary.
Upgrade
Version history
2.3.0-plugins.0latest on npm
Audit
Dependencies
esbuildrequiredCore transpilation engine.
Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-runner-plugins — npm install esbuild-runner-plugins · libregistry