Nub: The Node.js Toolkit That Finally Makes Sense (Or At Least Tries To)

If you’re a Node.js developer, you have to watch this video. But since you’re here reading my blog instead, let me save you 22 minutes of me talking with my hands and give you the good stuff. Two things I will never work without on any Node project: TypeScript and Zod for data validation. And when the author of Zod (Colin McDonnell) creates something new, I pay attention like a dog hearing a cheese wrapper. Today, we’re talking about nub – which is “bun” backwards, because we’re clever like that. (Also, did you know “node” rearranged is “dino”? The universe is weird.)

So, what is nub? It’s an all‑in‑one JavaScript toolkit that augments Node instead of trying to replace it. This is not Bun. This is not Deno. This is Node, but with all the goodies you wish it had out of the box. Colin argues that Node now has extension mechanisms that didn’t exist when Bun and Deno started – like pre‑loading scripts, module resolution plugins, and native add‑ons. Nub uses these to add Bun’s best features on top of stock Node. And honestly? That’s my dream. I want Node’s rock‑solid stability (because I’ve been burned before) but I also want to run TypeScript files without jumping through flaming hoops. I want fast installs. I want the whole experience to not make me cry.

Now, Bun is great – it gives you built‑in SQLite, S3 clients, image optimization, and a warm fuzzy feeling. But I’m perfectly fine installing packages myself; I’m a big boy. What I’m not fine with is segfaults at 3 AM that kill my Docker container and ruin my life. Yes, I’ve been there. We switched to Bun once, spent 6 hours debugging, only to realize the runtime itself was the problem. We reverted to Node with a heavy heart and a lot of wasted coffee. That’s when I discovered TSX – the unsung hero with 71 million weekly downloads – which saved us by transpiling TypeScript on the fly without creating garbage files everywhere. But now, nub might just replace TSX too.

What makes nub so special? Let me count the ways:

  • Auto‑installs Node versions – no more nvm or fnm. Just run `nub` and it detects your project’s required Node version, downloads it if needed, and runs your code. Magic.
  • 100% Node compatible – it’s literally Node under the hood, so no unexpected behavior divergences. It scores 98.8% on Deno’s Node compatibility test (compared to Bun’s 40% and Deno’s 78%).
  • Faster than a caffeinated squirrel – `nub run` is 24x faster than `pnpm run`, and `nubx` is 19x faster than `npx`. Sure, wall time might not change much, but it sounds impressive on paper, and that’s what counts.
  • Built‑in package manager – it’s like pnpm but faster, and it respects your existing lock files without throwing a tantrum. No more “screw you, I’m creating my own lock file” attitude.
  • 24‑hour cooling off for post‑install scripts – because supply chain attacks are real, and we all want to sleep soundly knowing a malicious package can’t pwn us within the first day.
  • Full TypeScript support – not just type stripping, but the real deal. Enums? They work. Monorepos? They work. Your sanity? Might actually survive.

And let’s not forget – nub auto‑unflags experimental Node features like `–experimental‑local‑storage` and `–experimental‑source‑maps`. So you can use them without messing with flags. Because who has time to read docs?

Now, I know what you’re thinking: “Is this a sponsored?” No, but honestly, with all the pain I’ve endured over the years – CommonJS vs ESM, module resolution hell, tsconfig dramas – I’d pay for a tool that just works. Nub gives me everything Bun promised, but without the segfaults and memory leaks. It’s still in public beta, but I’m giving it a spin, and you should too – especially if you’re a TypeScript or Node developer who values stability and a bit of sanity.

So, that’s nub. It’s everything but the runtime. It’s like Bun but reversed – and who doesn’t love a good reversal? Give it a try, and let me know in the comments if you’re still reading this far. Also, if you’ve ever been woken up by an OOM killer, you know why I’m excited. See you in the next one – and don’t forget to like, subscribe, and maybe leave a comment saying “I watched till the end” to prove you’re a true fan. Cheers! 🚀

Published on: 18 June
Posted by: Sami K.