logoalt Hacker News

Show HN: Nub – A Bun-like all-in-one toolkit for Node.js

86 pointsby colinmcdtoday at 2:14 PM13 commentsview on HN

Comments

colinmcdtoday at 2:23 PM

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...

show 1 reply
ivanjermakovtoday at 4:09 PM

Respect for embracing existing tech instead of rewriting a worse version of it. Wonder where we would be today if all alternative-building effort went to Node instead (with proper leadership).

show 1 reply
gorjusborgtoday at 3:38 PM

Very smart. You can't lose all your customers for vibe-coding a migration to Rust if you are already written in Rust ;)

show 1 reply
ssalbdivadtoday at 2:57 PM

Just merged a PR migrating our entire monorepo to nub.

0 issues, ridiculously fast.

show 1 reply
kandrostoday at 4:14 PM

Love the idea, learning a lot of interesting things about node hooks by reading docs and some code

sgarritytoday at 3:21 PM

I didn't even click on the link. I just came to give the author a hat-tip on the project name. Well played.

show 1 reply
bookernathtoday at 3:08 PM

Nice, I think this fills a niche. Does it work on cloudflare workers?

show 1 reply
GL26today at 3:13 PM

nice ! does this work on docker containers ?

show 1 reply