Why I don't use Node.js for hobby projects?

At previous work the most common tech stack by far was PostgreSQL + Node.js + React. Even if main portion of the project was not built with that stack, there usually was some Node.js component lurking nearby. If I recall correctly the earliest Node.js version I have seen in production environment is v0.8, that is almost 12 year old release! I have seen the io.js fork saga unfold. I remember the JS ecosystem evolving from CSP to CSP helpers, from CSP helpers to Promise/Thenable libraries (q, bluebird), from Promise libraries to native Promises and latest syntactic iteration: async-await.

That is around 10 years of mainly using JavaScript and Typescript at work, even when taking into account all the C++ and embedded projects I was involved with. So amount of JS/TS diffs I have written is probably in hundreds of thousands of lines.

So why I don't have any hobby projects with Node.js stack? Even with all the pros?

What are the Node.js pros?

The amount of good enough libraries is astounding! There probably isn't protocol or file format which doesn't have usable library readily available. Node.js ecosystem is popular enough that there is often multiple competing libraries or tools for the same task, with different tradeoffs and advantages.

Developer experience for starting new projects is astounding! Dependencies require just simple npm install and are ready to use, in both locally and in the host/container you are deploying to. For more complex project setups there is often popular project template available which requires just npx <template> my-project and off you go. One cannot deny how convenient the npm ecosystem is when project is starting or in full swing.

Node.js scaling! Hobby projects probably won't need the upwards scalability from asynchronous approach, but the Node's quite miniscule minimum requirements and resource usage when not under load are very nice. Running Node.js projects on single board computers like Raspberry Pi is not a problem.

Node.js cons

The most pressing issue is that ecosystem feels inherently unstable. There hasn't been huge shifts like iojs or Promises in a long time, but there is constant shuffle in library ecosystem. Which can be frustrating even when project has people working on it every day and thus amortizing all the work caused by the shifting foundation over longer time period. But this is horrible when touching a project maybe few time a year! Even isolated "update dependency to fix CVE" has real potential to evolve into cascading "update everything and everything is incompatible without code changes" nightmare. The nightmare situation is even more likely to happen when there are only bursts of development activity with long pauses between.

One can argue that solution is just not to use dependencies, but that npm ecosystem is one of the strong points of Node.js, not taking advantage of it would be kind of silly. Other sanity saving option would be to use older and maybe more stable libraries, but there are few gotchas.

It feels like more stable libraries are properly old (in JS timeframe) like Knex.js or Express, which comes with all the baggage from that age. Those libraries are born in times when there was no Promises, there was no TypeScript (or flow), no ECMAScript modules (CommonJS was not yet universal, like it was for while) and many other small ergonomic issues from modern standpoint. These old libraries have evolved with the times (causing, you guessed it, some minor compatibility problems), but they still come with some API warts that cannot be fixed without breaking every downstream project.

Then there is the more experimental libraries which might have really nice ergonomics but come with high risk of being abandoned or API instability. It is very difficult to guess which of those newer libraries will be around after a year or two. I can guess few reasons for the instability part: those libraries and tools tend to be either one person hobby projects or built by VC funded startups. Both of which have been in spotlight lately for issues related to them: abuse/burnout in case of hobby projects and walled gardens in case of company backed projects.

It feels like there is no middle ground between these two extremes.

So sadly it is hard to see situation getting better in the near future, which means that I won't be using JS/TS for my few hobby coding hours. Maybe that is good thing, doing my part to keep extra churn out of the ecosystem.