A fork of esbuild-register providing a hook for Node.js to transpile TypeScript, JSX, and modern JS on-the-fly using esbuild. Current version 0.0.4 requires esbuild >=0.19 <1. It aims to be a minimal drop-in replacement for ts-node with faster transpilation due to esbuild's speed. Unlike ts-node or sucrase, esbin is a thin wrapper around esbuild's transform API, offering no type checking. It is designed for development workflows where fast module loading is critical. The package is in early maintenance mode, with no breaking changes expected. Key differentiators: zero configuration, ESM and CJS support, and simple integration.
npm install esbinNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically register esbin with custom esbuild options and import TypeScript files, or use the CLI require hook.
Run a separate type check (e.g., tsc --noEmit) or use ts-node with type checking if needed.
Use import statements or use a dynamic import (e.g., await import('esbin/register')).Call register() at the very top of your entry point, or use the command line -r flag.
Consider using the original esbuild-register (though it's deprecated) or evaluate alternative solutions like tsx or ts-node.
Use only one require hook or loader at a time. For REPL, load esbin/register via -r.
Change to import statement or use dynamic import: await import('esbin/register').Use import { register } from 'esbin' instead of import register from 'esbin'.Use node -r esbin/register script.ts (note the trailing slash and register).