esno

raw JSON →
4.8.0 verified Fri May 01 auth: no javascript maintenance

esno is a Node.js runtime enhanced with esbuild for loading TypeScript and ESM files. It is an alias for tsx since v0.15, providing automated CJS/ESM mode and caching. Current stable version is 4.8.0. The project is in maintenance mode, with issues redirected to tsx. Key differentiators include zero-config TypeScript execution, esbuild-based transpilation for speed, and seamless CJS/ESM interop. It replaces older tools like ts-node.

error Cannot find module 'esno'
cause esno is only a CLI; no programmatic module exports.
fix
Use 'tsx' for programmatic usage or run via CLI with npx.
error esno: command not found
cause esno not installed globally or locally.
fix
Run 'npx esno' or install globally: 'npm i -g esno'.
deprecated esno v0.15+ is now an alias of tsx; standalone esno is deprecated.
fix Use tsx directly for new projects.
breaking Incorrect import path for commonjs usage
fix Use tsx's conditional exports; esno does not export programmatic API.
npm install esmo
yarn add esmo
pnpm add esmo

Shows zero-config TypeScript execution: a simple function with type annotation, run directly via esno CLI.

// First install: npm i -g esno
// Create hello.ts
export function greet(name: string): string {
  return `Hello, ${name}!`;
}
console.log(greet('World'));

// Run with:
// esno hello.ts