News for hackers. Stuff that matters.
Re:Modern Node.js Patterns by fleebee on Sunday August 03, 2025 @04:54PM (#44779701)
Nice post! There's a lot of stuff here that I had no idea was in built-in already.

I tried making a standalone executable with the command provided, but it produced a .blob which I believe still requires the Node runtime to run. I was able to make a true executable with postject per the Node docs[1], but a simple Hello World resulted in a 110 MB binary. This is probably a drawback worth mentioning.

Also, seeing those arbitrary timeout limits I can't help but think of the guy in Antarctica who had major headaches about hardcoded timeouts.[2]

[1]: https://nodejs.org/api/single-executable-applications.html

[2]: https://brr.fyi/posts/engineering-for-slow-internet

Re:Modern Node.js Patterns by llimllib on Sunday August 03, 2025 @05:19PM (#44779910)
I have a blog post[1] and accompanying repo[2] that shows how to use SEA to build a binary (and compares it to bun and deno) and strip it down to 67mb (for me, depends on the size of your local node binary).

[1]: https://notes.billmill.org/programming/javascript/Making_a_s...

[2]: https://github.com/llimllib/node-esbuild-executable#making-a...

Re:Modern Node.js Patterns by sgarland on Sunday August 03, 2025 @08:34PM (#44781089)
> 67 MB binary

I hope you can appreciate how utterly insane this sounds to anyone outside of the JS world. Good on you for reducing the size, but my god…

Re:Modern Node.js Patterns by llimllib on Sunday August 03, 2025 @10:10PM (#44781510)
lol, yes absolutely it's bananas. I wouldn't even consider myself in the JS world!
Re:Modern Node.js Patterns by int_19h on Monday August 04, 2025 @02:17AM (#44782590)
Have you looked at the average size of, say, a .NET bundled binary.
Re:Modern Node.js Patterns by tracker1 on Monday August 04, 2025 @12:52PM (#44788414)
Not sure why the down vote(s)... My main work project isn't that big yet, and the bin directory is like 96mb.

Not that I find it particularly egregious, but my rust (web-server) apps not even optimized are under 10mb easily.

Re:Modern Node.js Patterns by const_cast on Thursday August 07, 2025 @05:43PM (#44830739)
The difference is dotnet is both a much more feature complete runtime and a much more performant one. Its not like you're getting all too much with that node runtime - it was, and still is although to a lesser extent, pretty bare-bones.
Re:Modern Node.js Patterns by lacasito25 on Monday August 04, 2025 @04:59AM (#44783403)
Considering that you are bundling an entire runtime not meant to be installed independently on other computers, 67mb isn't that bad.

Go binaries weight 20mb for example.

Re:Modern Node.js Patterns by Culonavirus on Monday August 04, 2025 @11:46AM (#44787475)
It's not insane at all. Any binary that gets packed with the entire runtime will be in MBs. But that's the point, the end user downloads a standalone fragment and doesn't need to give a flying fuck about what kind of garbage has to be preinstalled for the damn binary to work. You think people care if a binary is 5MB or 50MB in 2025? It's more insane that you think it's insane than it is actually insane. Reminds me of all the Membros and Perfbros crying about Electron apps and meanwhile these things going brrrrrrr with 100MB+ binaries and 1GB+ eaten memory on untold millions of average computers
Re:Modern Node.js Patterns by sgarland on Monday August 04, 2025 @03:08PM (#44790137)
The fact that it’s normalized to use obscene amounts of memory for tiny apps should not be celebrated.

I assure you, at scale this belief makes infra fall apart, and I’ve seen it happen so, so many times. Web devs who have never thought about performance merrily chuck huge JSON blobs or serialized app models into the DB, keep clicking scale up when it gets awful, and then when that finally doesn’t work, someone who _does_ care gets hired to fix it. Except that person or team now has to not only fix years of accumulated cruft, but also has to change a deeply embedded culture, and fight for dev time against Product.

Re:Modern Node.js Patterns by vlucas on Monday August 04, 2025 @12:37PM (#44788191)
This packages the entire Node runtime and all project dependencies. It's not that insane.
Re:Modern Node.js Patterns by xdennis on Monday August 04, 2025 @04:26AM (#44783245)
Yeah, many people here are saying this is AI written. Possibly entirely.

It says: "You can now bundle your Node.js application into a single executable file", but doesn't actually provide the command to create the binary. Something like:

    npx postject hello NODE_SEA_BLOB sea-prep.blob \
        --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
Re:Modern Node.js Patterns by llamasushi on Wednesday August 06, 2025 @09:04PM (#44819566)
Yeah, this one line gave it away for me: "you’re not just writing contemporary code—you’re building applications that are more maintainable..."

Look up dialectical hedging. Dead AI giveaway.