Written by Piero Borrelli✏️
A good start is half the battle, said someone wiser than me. And I can’t think of any quote that would better describe...
For further actions, you may consider blocking this person and/or reporting abuse
"Use promises" is a bit 2015 kind of advice. Async / await is widely adopted and it is a step ahead of Promises.
That's like saying you won't be using promises with async/await.
It's just a different way of consuming them.
Exactly, I use promises exactly to get my async function to await for a second function to finish. They are different things
+1 for Rule #8: Use another layer for third-party services calls
I worked at 3 startups all involved with online payment, all switched from one payment processor (Stripe, Adyen, and whatnot) to another for a better rate or more features, mostly for a better rate. After going through the painful refactoring for the first 2, I realised I should've written a wrapper around whatever payment processor npm/API I would use
Yes but you have to create a unified API. Thankfully this should be easier for payment processors than for writing a unified DB access layer that would allow switching from MySQL to MongoDB.
Hey Brian,
Thanks for the great article. Any sample repo's to checkout?
Thanks,
Lionel
dev.to/faustrata1/nodejs-boilerpla...
i'm interesting for this deal.
What do you mean?
Good writing, but I'd not use
express
for any kind of project.If you want a real stack use something like Adonis or Nest which have been built to create application/api at scale.
By default, NestJs uses Express under the hood, so at least having good knowledge in Express, for me, may help in understanding and using NestJs for large scale apps.
As for AdonisJs, it looks very promising, since it is similar to Laravel for PHP. Having used Laravel in my last project, I think I can get started relatively quickly with AdonisJs. I just want to be convinced that this framework is really reliable, because I don't know, I always feel hesitant about it.
Rule #6 has some buggy code. database is specified for the arrow function param but db is being called
You noticed too? Well, we all get the gist tho 😉
Do you have some project as boilerplate where I can follow these valuable rules?
If yes,do you mind to share it?
Thanks for your post!
Congrats.
I'd like to point of Rule #13.
The problem when use compression library you may have lot of CPU usage. The good approach for this use case is using a reverse proxy, like ngnix.
Your article is interesting for beginners. CLI provided by frameworks (Vuejs, Angular, express) are generating scaffolds to learn from! It's a good starting point to follow.
Thanks!
Wonder if you have more examples on how to execute the piece of code about DI from a caller perspective. Thanks, great post.
Thank you for this post! this was very helpful 🌻
I'm always amazed at how under-architected most node code is.
I really liked the functional approach of the dependency injection