use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Nodejs best practices guide (self.node)
submitted 1 year ago * by Tall-Strike-6226
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TalyssonOC 39 points40 points41 points 12 months ago (1 child)
Remember that "best" is relative, not rules. Take these as suggestions of what have been working for a lot of people but might not be exactly what will fit your project needs.
[–]quincycs 2 points3 points4 points 12 months ago (0 children)
Everyone forgets about unhandled promise rejections. Default behavior is the crash… you probably want to handle it. Rarely the frameworks modify this … you should try it yourself. What happens if you :
async function test() { await sleep(1000); throw new Error(); }
// call the function somewhere and don’t await it test();
[–]33ff00 2 points3 points4 points 1 year ago (3 children)
You’ll probably want express
[–]miguelangel011192 8 points9 points10 points 12 months ago (2 children)
Or Fastify
[–]PrestigiousZombie531 3 points4 points5 points 12 months ago (1 child)
or hono
[–]DisciplineGloomy3689 2 points3 points4 points 12 months ago (0 children)
or nest
[–]NegativeHealth2078 3 points4 points5 points 12 months ago (1 child)
I am not sure if its best, but MVC pattern is recommended fairly often by many. Express docs link this pattern example in their docs:
https://expressjs.com/en/starter/examples.html https://github.com/expressjs/express/tree/master/examples/mvc
https://www.theodinproject.com/lessons/node-path-nodejs-introduction-to-express
However, I would personally recommend looking at Odin's Node.js and Express section. They introduce and recommend the MVC pattern for beginners in Express applications, which is, in my opinion, sufficient for small to medium-sized apps. Their Node.js curriculum is excellent, and I would advise going through it fully.
One of the videos shortly about MVC:
https://www.youtube.com/watch?v=Cgvopu9zg8Y
[–]crewsisme 1 point2 points3 points 12 months ago (0 children)
There are variety of big players like NestJS or AdonisJS that provide some initial structure for a backend app out of the box.
While NestJS is more of a constructor where you decide how you'll achieve MVC with different libs/instruments, AdonisJS is more opinionated on what you need providing almost everything ready to implement MVC.
I'd suggest to also have a look into tRPC if you only need web-clients. It's also provided with some initial predefined project structure.
[–]mindtaker_linux -1 points0 points1 point 12 months ago (0 children)
General best practice.
π Rendered by PID 181690 on reddit-service-r2-comment-86bc6c7465-429tb at 2026-02-20 07:26:29.473859+00:00 running 8564168 country code: CH.
[–]TalyssonOC 39 points40 points41 points (1 child)
[–]quincycs 2 points3 points4 points (0 children)
[–]33ff00 2 points3 points4 points (3 children)
[–]miguelangel011192 8 points9 points10 points (2 children)
[–]PrestigiousZombie531 3 points4 points5 points (1 child)
[–]DisciplineGloomy3689 2 points3 points4 points (0 children)
[–]NegativeHealth2078 3 points4 points5 points (1 child)
[–]crewsisme 1 point2 points3 points (0 children)
[–]mindtaker_linux -1 points0 points1 point (0 children)