Node.js: Crypto Keys Get Raw and REPL Gets Refined
Today's Node.js updates bring exciting crypto enhancements with raw key format support for KeyObject APIs and a smart REPL optimization using VM's DONT_CONTEXTIFY context. Plus, we've got test stability improvements and fresh Web Platform Test updates that keep Node.js running smoothly.
Duration: PT4M4S
Transcript
Hey there, amazing developers! Welcome back to another episode of the Node.js podcast. I'm your host, and wow, do we have some fantastic updates to dive into today, March 26th, 2026. Grab your favorite beverage because we're about to explore some really cool improvements that landed in the Node.js codebase.
Let's start with our merged pull requests, and I have to say, there are two gems here that really caught my attention.
First up, we've got a nice test stability fix from inoway46. You know how flaky tests can be the bane of our existence? Well, they tackled a particularly stubborn one in the debugger restart functionality. The issue was happening specifically on macOS with those unusual-path runs, where the test was expecting a break message immediately after calling `stepCommand('run')`, but sometimes `run` would return an "ok" prompt before the break output showed up. Classic timing issue, right?
The fix is elegantly simple - they switched to using `command('run')` instead and kept `waitForInitialBreak()` for the actual break synchronization. It's just a four-line change, but these kinds of improvements make our CI more reliable and our development experience so much smoother.
Now, here's where things get really interesting. Our second merged PR from legendecas brings a subtle but important optimization to the REPL. They've switched the REPL to use VM's `DONT_CONTEXTIFY` context instead of the regular contextified one. Now, you might be wondering, "What does that even mean?"
Think of it this way - the REPL doesn't actually need all the fancy interception behavior that comes with a regular VM context. By using `DONT_CONTEXTIFY`, they're essentially saying, "Hey, we just want a clean, simple context without all the extra overhead." This change makes the REPL more resilient to V8 interceptor API changes and reduces complexity under the hood. The beautiful part? You won't notice any difference in how the REPL behaves - it's purely an internal optimization that makes things more robust.
Moving on to our additional commits, and oh my goodness, Filip Skokan has delivered something absolutely massive in the crypto space. We're talking about raw key format support for KeyObject APIs! This is huge, folks.
The commit adds support for raw-public, raw-private, and raw-seed formats to `KeyObject.prototype.export()`, `crypto.createPrivateKey()`, and `crypto.createPublicKey()`. This works with EC curves, CFRG curves, ML-DSA, ML-KEM, and SLH-DSA keys. But here's the kicker - they also removed the unnecessary KeyExportJob classes because, as Filip points out, these export operations aren't computationally expensive. They're just serializing data that's already available, so running them on the thread pool was adding unnecessary overhead.
This is a perfect example of making APIs more efficient while expanding their capabilities. The change touches 34 files and includes comprehensive benchmarks and tests. It's the kind of improvement that makes Node.js even more powerful for crypto operations while actually making things faster.
We also got our regular Web Platform Test updates from the Node.js GitHub Bot, keeping us in sync with the latest web standards, and Aviv Keller made a nice improvement to use the npm-published version of doc-kit in our documentation tooling.
Today's Focus: If you're working with cryptographic operations in Node.js, definitely check out the new raw key format support. It opens up new possibilities for how you handle keys in your applications. And if you've been experiencing any flaky tests in your own projects, take inspiration from that debugger fix - sometimes the solution is switching to a more appropriate API call that better matches your timing expectations.
That's a wrap on today's Node.js updates! The community continues to make Node.js more stable, more capable, and more efficient with every change. Keep coding, keep learning, and I'll catch you in the next episode!