Live data from Hacker News

Modern Node.js Patterns

kashw1n.com

121–130 of 448 posts

Re: Modern Node.js Patterns

#121
post #94

Is current node.js a better language than .NET 6/7/8/9, why or why not?

Node.js is a runtime, not a language. It is quite capable, but as per usual, it depends on what you need/have/know, ASP.NET Core is a very good choice too.

> ASP.NET Core is a very good choice too.

I have found this to not be true.

Re: Modern Node.js Patterns

#123
post #107
post #27

Earlier quoted context omitted.

node fetch is WAY better than axios (easier to use/understand, simpler); didn't really know people were still using axios

This is all very good news. I just got an alert about a vulnerability in a dependency of axios (it's an older project). Getting rid of these dependencies is a much more attractive solution than merely upgrading them.

isn't upgrading node going to ba bigger challenge? (if you're on a node version that's no longer receiving maintenance)

Re: Modern Node.js Patterns

#124
post #10

This is great. I learned several things reading this that I can immediately apply to my small personal projects. 1. Node has built in test support now: looks like I can drop jest! 2. Node has built in watch support now: looks like I can drop nodemon!

Eh, the Node test stuff is pretty crappy, and the Node people aren't interested in improving it. Try it for a few weeks before diving headfirst into it, and you'll see what I mean (and then if you go to file about those issues, you'll see the Node team not care).

still I would rather use that than import mocha, chai, Sinon, istanbul.

At the end it's just tests, the syntax might be more verbose but Llms write it anyway ;-)

Re: Modern Node.js Patterns

#126
post #74

The killer upgrade here isn’t ESM. It’s Node baking fetch + AbortController into core. Dropping axios/node-fetch trimmed my Lambda bundle and shaved about 100 ms off cold-start latency. If you’re still npm i axios out of habit, 2025 Node is your cue to drop the training wheels.

It has always astonished me that platforms did not have first class, native "http client" support. Pretty much every project in the past 20 years has needed such a thing. Also, "fetch" is lousy naming considering most API calls are POST.

That's a category error. Fetch is just refers to making a request. POST is the method or the HTTP verb used when making the request. If you're really keen, you could roll your own

  const post = (url) => fetch(url, {method:"POST"})

Re: Modern Node.js Patterns

#128

Is current node.js a better language than .NET 6/7/8/9, why or why not?

In my experience, no.

It's still single-threaded, it still uses millions of tiny files (making startup very slow), it still has wildly inconsistent basic management because it doesn't have "batteries included", etc...

Re: Modern Node.js Patterns

#129
post #94

Earlier quoted context omitted.

Node.js is a runtime, not a language. It is quite capable, but as per usual, it depends on what you need/have/know, ASP.NET Core is a very good choice too.

> ASP.NET Core is a very good choice too. I have found this to not be true.

Recently?

In my experience ASP.NET 9 is vastly more productive and capable than Node.js. It has a nicer developer experience, it is faster to compile, faster to deploy, faster to start, serves responses faster, it has more "batteries included", etc, etc...

What's the downside?

Re: Modern Node.js Patterns

#130
Perhaps the technology that you are using is loaded with hundreds of foot-guns if you have to spend time on enforcing these patterns.

Rather than taking the logical focus on making money, it is wasting time on shuffling around code and being an architecture astronaut with the main focus on details rather than shipping.

One of the biggest errors one can make is still using Node.js and Javascript on the server in 2025.

Post reply on HN