Node.js tips and tricks to deliver more secure and robust applications.
You should use tools like npm audit or snyk to check for vulnerable dependencies. You can also use dependabot to keep yourself updated.
You should name all the functions, closures and callbacks. This will help you easily understand what you are looking for from memory snapshots while profiling your application.
Libuv is an open-source library that handles the thread-pool which is used by node for many asynchronous operations like file I/O.
You should use a Task Queuing System for performing heavy computation tasks in the background. I'll recommend you to check the Bull or Kue package.
Static type checker will empower you to find certain problems even before your code executes. It is certainly helpful as you will get fewer surprises on the runtime of your application.
You can use the node's cluster module which will help you spawn a process for each core with a few lines of code. You can even use PM2 for this which makes it even more simple.
Thank you for reading 🐨🎉 Let me know your thoughts in comments.