The readme says Websockets support is native from Node 22, except Node does not have a native Websockets library. Their link for Websockets standard goes to MDN, which is fine except that only describes the WHATWG user interface and nothing about the protocol or how Websockets works. It feels like this is missing something or using a nonnative library as a supplemental addition.
Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
71–80 of 85 posts
Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#72Hasn't Node been able to run TypeScript for a couple of versions? Why's the transpiler needed?
https://github.com/nodejs/typescript/issues/51#issuecomment-...
Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#73Earlier quoted context omitted.
Right now, you should use Nub on the backend if you are relying on its augmentations. If you specifically want to disable Nub's augmentations (so you have a guarantee that your app/script will "just work" with regular Node, there's a couple ways to disable it. NODE_COMPAT=0 nub index.ts nub --node index.ts I'll investigate a `nub build` that would do the transpilation upfront and properly chunk/bundle a prod build. I…
I'm seeing lots of bots/agents misusing backticks like this. It's because people are writing agent plans in markdown and the agent thinks it's appropriate everywhere. Maybe you shouldn't be running all your comment replies through Claude.
Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#74what's wrong with bun? And how is this better?
Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#75The readme says Websockets support is native from Node 22, except Node does not have a native Websockets library. Their link for Websockets standard goes to MDN, which is fine except that only describes the WHATWG user interface and nothing about the protocol or how Websockets works. It feels like this is missing something or using a nonnative library as a supplemental addition.
Node supports a built-in WebSocket client since 22, but not a server.
https://nodejs.org/learn/getting-started/websocket
It is under the site's learn tab, but never mentioned in the API/library documentation.
It's also weird because the only difference between a WebSocket client and server is that a server is a connection listener that responds to the handshake. The client is responsible for absolutely everything else: send messages, receive messages, initiate the connection, kill the connection, ping/pong. After the client accepts the server's handshake response the server becomes the other client performing exactly the same functionality. Node could have been doing that all along since adding client support.
Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#76Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#77Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#78Re: Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
#79I've got a couple of decent-sized products running on Deno (and I've been a fan since it came out, not so much since 1.0 and 2.0, but still feel it's better than Node), but Node has been catching up and Deno has slowed down, so this might be the "compatibility middleware" that'll get me to move things back to Node.
Will keep a close eye on it.