cloudy-node

raw JSON →
0.0.81 verified Fri May 01 auth: no javascript

cloudy-node is a TypeScript and ESM runtime for Node.js (>= 14.18) that uses esbuild under the hood to transpile TypeScript on the fly. Current stable version is 0.0.81. It is a fork of esno with a key differentiator: the esbuild target is set to es2022 instead of es2019, avoiding problematic helper generation that breaks Pulumi function serialization and enabling top-level await support (e.g., for AWS Lambda Node.js 14). It provides a CLI command and a Node --loader hook for seamless execution of .ts files. Compared to ts-node or tsx, it is more lightweight and focuses on esbuild speed, but may have fewer features and less community support.

error TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /path/to/file.ts
cause Running TypeScript file directly with `node` without the loader.
fix
Use node --loader cloudy-node index.ts or the cloudy-node binary.
error Error: Cannot find module 'cloudy-node'
cause Package not installed or not in node_modules.
fix
Run npm install cloudy-node or yarn add cloudy-node.
error Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension
cause Node expects ESM but package.json does not have `"type": "module"` and file is .ts without loader.
fix
Use --loader cloudy-node or set type: module, or use the cloudy-node CLI which handles it automatically.
gotcha cloudy-node expects a TypeScript file as the entry point; passing a JavaScript file may still work but is redundant.
fix Ensure your entry file has a .ts extension for intended behavior.
gotcha The --loader flag uses a custom loader; Node.js experimental warnings may appear in some versions.
fix Suppress warnings with `--no-warnings` flag if desired.
gotcha cloudy-node targets es2022; code using features from later ES versions may not transpile correctly.
fix Use a different tool if you need newer target, or adjust tsconfig.json if applicable.
gotcha The package is a fork of esno; some esno flags or behavior may differ.
fix Check cloudy-node documentation for supported options.
npm install cloudy-node
yarn add cloudy-node
pnpm add cloudy-node

Shows running a simple TypeScript file using the cloudy-node CLI.

echo 'console.log("Hello from cloudy-node!");' > hello.ts
npx cloudy-node hello.ts