What should I use instead of #Express and #Handlebars for a web application in Node.js in 2023? Can someone summarise pros and cons of the most popular alternatives? I see way too many…
Alternatives to #Express:
Koa, which can either replace or complement both Express and Connect.
Fastify, which looks straightforward and very similar to Express. Plugin for templating (supporting Handlebars, Mustache, Pug and EJS): @fastify/view.
NestJS, which seems too convoluted and probably redundant since it works on top of either Express or Fastify (?).
Meteor: more of a platform. No tutorial for vanilla JS (only for React, Vue, etc), and not oriented towards SSR.
I’ll probably go for #Koa or #Fastify.
#JS #JavaScript
#Node.js #Node
Alternatives to #Handlebars:
Mustache: zero dependencies, and dead simple. Too simple? Being logic-less means that conditionals and loops are pre-cooked, and that may limit options.
Pug: main advantage and main drawback: its concise but idiosyncratic syntax, similar to that of #Slim — which I know and have used in the past, but is too much of a departure from #HTML.
EJS: similar to Handlebars, simple but apparently versatile. Documentation isn’t great.
#JS #JavaScript
#Node.js #Node
The plugin ecosystem for templating engines in Express is (still) larger than in Koa.
In particular, for #Handlebars, there seem to be just 3 in #Koa, and all quite outdated (last updated in 2016, 2017 and 2017).
@tripu I don't know which project you have in mind, but I would very much would like to do something with Django and htmx (https://htmx.org/) or unpoly (https://unpoly.com/).
@tripu Maybe start off with simplicity (Mustache) and see how it goes? It may turn out to be all you need. If not, and you decide to switch down the line, you can just get AI to convert any existing files.
@tripu polka + yeahjs.
both smaller/faster than express/ejs with similar APIs, and 0 dependencies. eta is a little more powerful than yeahjs, but you probably won't need the extra features
https://github.com/lukeed/polka
https://github.com/mourner/yeahjs
https://github.com/eta-dev/eta
@tripu I lied, polka has two dependencies, but they are 0 deps themselves, tiny, and by the same author
https://alternativeto.net/software/expressjs/
https://stackshare.io/expressjs/alternatives
https://alternativeto.net/software/handlebars/
https://stackshare.io/handlebars/alternatives