Nub — Fast TypeScript/Node Toolchain (nub)
Installs nub: a single Rust binary that runs TypeScript/JavaScript files, package.json scripts, and local CLIs directly on top of the Node.js and package manager already in the container — no new runtime, no lock-in.
Why this feature exists
Section titled “Why this feature exists”nub is explicitly not a replacement runtime: “runs on the node and package manager you already have.” It accelerates three things that are normally slow because of Node’s own CLI-wrapper overhead:
- Running a
.ts/.jsfile directly (nub file.ts) — faster startup thantsx/ts-node, fulltsconfig.jsonsupport. - Running a
package.jsonscript (nub run <script>) — faster thannpm run/pnpm run. - Running a local CLI binary (
nubx <cli>) — faster thannpx <cli>, no Node wrapper.
It also has its own dependency installer (nub install) with a unified interface across npm/pnpm/bun lockfiles, and its own Node-version manager — this feature deliberately doesn’t use the latter. Node’s own version is already this container’s responsibility via the official node feature (dependsOn below); letting nub node install manage a second, independent version would create two competing version-selection mechanisms in the same container. Use nub for the speed, not for the version management.
Example Usage
Section titled “Example Usage”Pin a specific release instead of the default latest:
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
version |
string | latest |
Version of nub to install, or a specific release like 1.2.3. |
installGlobally |
boolean | true |
Symlink nub/nubx into /usr/local/bin so they’re available system-wide (all users, root, sudo) without relying on the target user’s own $PATH. |
How it works
Section titled “How it works”- Runs the official installer as the container’s target non-root user (not root — the installer resolves its default install location from
$HOME), withNUB_INSTALL_DIR=~/.nubandNUB_NO_MODIFY_PATH=1so it never edits~/.bashrc/~/.zshrcitself. - If
installGlobally(default), symlinks every binary under~/.nub/bin/(nubandnubx, the latter dispatching onargv[0]) into/usr/local/bin.
No VS Code extension — nub doesn’t have one. This feature is CLI tooling only.
What this feature does not do
Section titled “What this feature does not do”- Does not install the
nubnpm/pnpm shims (nub pm shim, which hardlinks~/.nub/shims/{npm,npx,…}to transparently intercept package-manager calls). That’s a deeper, PATH-wide interception decision left to the consuming project to opt into explicitly — this feature only makes thenub/nubxbinaries available. - Does not manage Node versions. See “Why this feature exists” above.
- nub: https://nubjs.com/
- Docs: https://nubjs.com/docs
- Source: https://github.com/nubjs/nub
Version History
Section titled “Version History”- v1.0.0: Initial release.
