Post

Node.js now provides a powerful set of extension mechanisms that (mostly) didn't exist when Deno/Bun started: πŸ‘‰ preload scripts (--import) πŸ‘‰ module resolution plugins (module.registerHooks) πŸ‘‰ Node-API native addons

Nub uses these to add Bun's best features on top of stock Node.js βœ… non-erasable TS syntax (e.g. enums) βœ… TS-friendly module resolution (tsconfig-paths, extensionless imports) βœ… JSX βœ… decorators βœ… .env autoloading βœ… yaml/toml imports βœ… `Worker` βœ… `using` βœ… a lot more

When you run a file, Nub detects your project's Node version, auto-installs it if needed, and runs your code with it (no nvm/fnm needed) β€” including all the augmentations above It respects (in order) πŸ‘‰ package.json#devEngines πŸ‘‰ .node-version πŸ‘‰ .nvmrc πŸ‘‰ package.json#engines

It takes the safest default security posture of any package manager in the ecosystem πŸ” 24hr minReleaseAge πŸ” checks OSV for known vulns during resolution (never installs known-bad pkgs) πŸ” blocks postinstall by default πŸ” blocks trust downgrades (e.g. recent versions that lost npm provenance)

0 reposts4 likes

One of the features that's in the making is a convenient way to apply Node permission model to scripts so your linting can work offline etc.

Nub detects your existing package manager (via package.json or lockfile) and runs in COMPAT MODE πŸ” reads *and writes* your existing lockfile (roundtrip!) βš™οΈ respects your config files (see chart) ⚑️ zero config changes required in 99% of cases (Nub aborts when unsupported config is detected)

nub pm shim β€” A built-in package manager shimmer Like `corepack enable`, this registers global shims for npm, yarn, and pnpm. These shims intercept your commands and: - Detect the version used in your project - Install that version if needed - Run the command using the proper version