Node.js runtime enhanced with esbuild for loading TypeScript & ESM
npx @tessl/cli install tessl/npm-esno@4.8.0esno is a Node.js runtime enhancement tool that enables seamless execution of TypeScript and ESM modules using esbuild for fast compilation. As of version 0.15+, esno serves as a convenient alias for the tsx package, offering automated CJS/ESM mode detection and caching capabilities.
npm install esno or npm install -g esnoesno is primarily used as a CLI tool and does not provide a programmatic API for imports. All functionality is accessed via the command line.
Execute TypeScript files directly without pre-compilation:
npx esno hello.tsInstall globally for convenient usage:
npm install -g esno
esno index.tsAdd to package.json scripts:
{
"scripts": {
"start": "esno index.ts",
"dev": "esno src/main.ts"
},
"dependencies": {
"esno": "^4.8.0"
}
}Then run:
npm run startesno is built as a thin wrapper around the tsx package:
esno executable (esno.js) imports and delegates to tsx/cli"type": "module"Primary capability for executing TypeScript and JavaScript files with enhanced Node.js runtime.
esno [file] [arguments...]Parameters:
file - Path to the TypeScript or JavaScript file to executearguments... - Command line arguments to pass to the executed scriptUsage Examples:
# Execute a TypeScript file
esno app.ts
# Execute with arguments
esno script.ts --config production --port 8080
# Execute from current directory
esno ./src/index.ts
# Execute with environment variables
NODE_ENV=production esno server.tsSupported File Types:
.ts - TypeScript files.tsx - TypeScript JSX files.js - JavaScript files (ESM or CommonJS).jsx - JavaScript JSX files.mjs - ECMAScript modules.cjs - CommonJS modulesFeatures:
esno delegates all execution to tsx, so error handling follows tsx patterns:
esno has minimal dependencies:
{
"dependencies": {
"tsx": "^4.19.1"
}
}All core functionality is provided by the tsx package, which esno wraps for convenience.