
Member-only story
Node.js Packages I Use In Every Project
And why you should use them too!
Throughout my career, as probably many of you, I have created dozens of new JavaScript projects both for personal as well as professional use. As with everything, once you do something often enough, you establish common patterns, routines, and best practices. In this post, I want to talk about the best Node.js packages I use every time and how they can also help you to reduce development time and extend the performance of your JavaScript application in no time.
The packages in this list a suitable for almost all JavaScript projects and not specific to a framework or library such as React, Angular, Express, NestJS, etc. I’ve also excluded utility function libraries such as lodash or rambda, or date/time conversion libraries like momentjs or date-fns. And I’ve excluded bundlers like Webpack, ESBuild, Rollup, or Parcel as those are again very specific to the kind of project you’re working on. Instead, I tried to focus specifically on packages I’m using for project setup, development, build, and maintenance, that you might have overlooked before. And while some of the ones listed here you surely already know, others are hopefully new to you as well. If you disagree with a pick or have additional suggestions, please let me know!
Code Formatting
Let’s start with the basics: Writing good code (whatever that means). When you’re working in a team, it is sometimes difficult to keep a consistent formatting and coding style of your codebase. After all, some people prefer tabs over spaces (monsters!), some use single quotes for strings, others double. Sometimes there’s a semicolon at the end of a JavaScript statement, and so forth. This is where code formatting and validation libraries come in! Some tools are even able to go beyond simple formatting and style, but can actively help you write arguably better, faster, and more secure code.
Here are the few I’m using in every single JavaScript project:
Prettier
Prettier is a command-line tool and also exists as an extension for Visual Studio Code and other IDEs. It automatically formats your code and enforces a common coding style (think tabs vs spaces, quoting style, etc.).