Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
github.com - 130 poäng - 30 kommentarer - 14540 sekunder sedan
Kommentarer (10)
- colinmcd - 13968 sekunder sedanColin 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...
- ivanjermakov - 7641 sekunder sedanRespect 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).
- gorjusborg - 9493 sekunder sedanVery smart. You can't lose all your customers for vibe-coding a migration to Rust if you are already written in Rust ;)
- ssalbdivad - 11967 sekunder sedanJust merged a PR migrating our entire monorepo to nub.
0 issues, ridiculously fast.
- skybrian - 5446 sekunder sedan> TypeScript-friendly resolution: extensionless imports, tsconfig.json#paths
I’m wondering how that works. Deno has very complicated import resolution, so building my own import resolver to be compatible with it is a bit of a pain. (This is for a custom lint-like tool.)
- kandros - 7305 sekunder sedanLove the idea, learning a lot of interesting things about node hooks by reading docs and some code
- sgarrity - 10496 sekunder sedanI didn't even click on the link. I just came to give the author a hat-tip on the project name. Well played.
- bookernath - 11315 sekunder sedanNice, I think this fills a niche. Does it work on cloudflare workers?
- montroser - 6143 sekunder sedanNice. Can we get `nub --compile` up in there like Bun has?
- GL26 - 11016 sekunder sedannice ! does this work on docker containers ?
Nördnytt! 🤓