Using NPM Packages
Writing repetitive code is easily the bane of every coder’s existence. No one wants to continue copying and pasting code all throughout their project. Rather than writing long chunks of code, having a concise, readable structure is key for good code.
Enter NPM Packages.
Node.js applications use the over million open-source packages that are present in the NPM package library. These are used from the smallest, everyday projects to the larger, more complex ones. Currently, it is estimated that 97% of code in modern web apps comes from NPM modules.
Installing and using them is as easy as opening a terminal window and writing the command npm i [name of package]. Using them is also critical to getting any web application to function properly.
Here are some of the most useful and widely used packages.
Bcrypt => A library to help you hash passwords.
Debug => A debugging utility modelled after Node.js core’s debugging technique. Works in Node.js and web browsers.
ESLint => statically analyzes your code to quickly find problems.
Nodemon => a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development.