Registry / devops / esbuild-cli

esbuild-cli

JSON →
library0.0.1jsnpmunverified

esbuild-cli v0.0.1 provides a real-time esbuild wrapper for CLI applications, enabling fast bundling and transpilation with TypeScript support. It targets Node >=16 and focuses on interactive development workflows. As a very early release (0.0.x), it lacks maturity and should be used with caution. Key differentiators: real-time rebuilds and CLI integration, but alternatives like esbuild's own CLI or tools like tsx are more stable and feature-rich.

npm install esbuild-cli
INSTALL
IMPORT
SIG · ESBUILD-CLI
E
esbuild-cli
devopsjavascriptv0.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.

default
import esbuildCli from 'esbuild-cli'
const esbuildCli = require('esbuild-cli')
ESM-only package; require() will fail.
build
import { build } from 'esbuild-cli'
Named export for programmatic use.
cli
import { cli } from 'esbuild-cli'
Top-level CLI function.

Basic usage of the build function to bundle a TypeScript entry point for Node.js. Note: requires Node >=16.

import { build } from 'esbuild-cli'; // Example: bundle a TypeScript file for Node.js build({ entryPoints: ['./src/index.ts'], outfile: './dist/index.js', platform: 'node', target: 'node16', format: 'esm', bundle: true, }).catch(err => { console.error('Build failed:', err); process.exit(1); });
esbuild-cli --version
Debug
Known issues
gotchaThe package is at version 0.0.1; API surface is unstable and may change without notice.
fix
Lock to a specific version and test upgrades carefully.
affects: <=0.0.1
breakingESM-only package; require() will throw ERR_REQUIRE_ESM.
fix
Use import syntax or dynamic import().
affects: >=0.0.0
gotchaNode engine requirement is >=16; older versions cause runtime errors.
fix
Update Node.js to 16 or later.
affects: >=0.0.0
deprecatedNo known deprecation as of version 0.0.1.
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Package is ESM-only, but used with require().
fix
Change to import or use dynamic import().
TypeError: build is not a function
Incorrect import of default export vs named export.
fix
Use import { build } from 'esbuild-cli' or import esbuildCli from 'esbuild-cli' then use esbuildCli.build().
Error: Cannot find module 'esbuild'
Missing peer dependency esbuild.
fix
Install esbuild as a dependency: npm install esbuild.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-cli — npm install esbuild-cli · libregistry