Hacker News new | ask | show | jobs
Show HN: Nub – A Bun-like all-in-one toolkit for Node.js (github.com)
59 points by colinmcd 1 hour ago
6 comments

Very smart. You can't lose all your customers for vibe-coding a migration to Rust if you are already written in Rust ;)
They'll get bought out by OpenAI and convert the project to Zig
Colin here, creator of Nub. I’ve had the general shape of this in mind for years. Nub runs your code with stock `node`, augmented with a `--require` preload hook[0] that adds a transpiler (oxc-powered, packaged as a Node-API add-on), registers a module resolution hook[1], and injects polyfills as needed for APIs like `Worker`, `Temporal`, etc. All purely additive, your code ultimately runs using Node’s actual engine & stdlib implementations.

[0] https://nodejs.org/api/cli.html#-require-module

[1] https://nodejs.org/api/module.html#moduleregisterhooksoption...

I saw this on twitter and loved it, such a good move on your part Colin. Hope the project picks up tons of steam!
I didn't even click on the link. I just came to give the author a hat-tip on the project name. Well played.
Thanks :) Highly recommend clicking the link too!
Just merged a PR migrating our entire monorepo to nub.

0 issues, ridiculously fast.

Nice, I think this fills a niche. Does it work on cloudflare workers?
Cloudflare Workers is a different runtime and has its own toolchain around it. Nub could theoretically support it when executing files (spawn `wrangler dev` instead of `node` if wrangler.toml is detected or something) but really I'm focused on making the Node.js experience as good as possible.

The other pieces of the toolkit could absolutely be used: package manager, script runner, package runner. Works with anything that implements the Node module resolution algorithm (actually Yarn PnP also works out of the box...).

nice ! does this work on docker containers ?
Yep, full support on macOS, Linux, Windows. No official image yet (I'll start on this now) but you can get started with something like this.

  FROM node:26-slim
  RUN npm i -g @nubjs/nub
Works with any Node version down to 18.19 but recommend 22.15+ for best performance (that's when synchronous registerHooks was introduced[0])

[0] https://nodejs.org/api/module.html#moduleregisterhooksoption...