One binary to run TypeScript on Node, dispatch package.json scripts, install dependencies, invoke local bins, and manage Node versions without a new runtime.
Overview
Nub is a command-line toolkit that wraps standard Node.js instead of replacing it. Written in Rust, it aims to cover file execution, script running, package running, dependency installation, watch mode, Corepack-style package-manager shims, and manual Node version selection in one installable binary.
The file runner transpiles JavaScript, TypeScript, JSX, and related extensions in memory—via an embedded oxc addon—and forwards execution to a real node binary with flag compatibility. It loads .env files, honors tsconfig paths through module hooks, and can auto-download the Node version implied by .node-version, .nvmrc, engines, or devEngines fields.
nub run is positioned as a faster replacement for npm run and pnpm run from a Rust dispatcher, while nubx mirrors npx and pnpm dlx with less Node bootstrap overhead. nub install is a pnpm-flag-compatible installer using the Aube engine and can enter compatibility mode for existing npm, pnpm, Yarn, or Bun lockfiles. nub pm reproduces corepack-style shims, and nub node manages explicit Node installs.
The project stresses no proprietary runtime APIs: output runs on stock Node with optional polyfills and unflagged experimental modules. Install paths mentioned include curl, Homebrew, npm, and mise.
Key features
- TypeScript and JSX on stock Node
- Automatic .env and tsconfig paths
- Fast package.json script runner
- npx-style local and registry bin runner
- pnpm-compatible nub install
- Corepack-style nub pm shims
- Built-in Node version provisioning
- Dependency-aware nub watch mode
Use cases
- Replacing tsx, dotenv, and nvm in one tool
- Faster day-to-day npm or pnpm scripts
- Monorepos keeping incumbent lockfile tooling
- CI using nubjs/setup-nub instead of setup-node