Top 5 common and useful libraries for Node.js developers

0 29
Avatar for bala41288
3 years ago

I would like to say that the best thing that happened in my career was to know that it was possible to write Javascript code in the backend and run backend service completely with Javascript. Thanks to the v8 javascript engine and thanks to the Node js developers who thought about that idea. I have been enjoying this for nearly 5 years building lots of apps in my real world as well as the crypto world.

Source

But I'm still a learner and I keep learning new things every single day. I come across lots of packages that surprise me and make my work easier. The good thing about Node js is that we don't have to write all the code we need, we can look for packages that have some support for what we would like to achieve and just include that package in our project. NPM has been a great support for every developer. Not only in the backend but also in the front-end development. After NPM became a hit there are also developers writing code completely in the front end without even having a need to have a backend. These are some of the tricks and betterment Node js has given us.

I would like to list out some of the useful libraries which I mandatorily have in all my projects or at least most of my projects.

1) Eslint

Linting is highly essential. For any type of coding we do, following a standard is very important because it will not only make the code look and feel better but it also reduces the possibility to do errors. Our code can be neat and we can easily avoid mistakes that we do sometimes without our knowledge. I always start my project with eslint and I use air-bnb as my standard for building. There are many standards out there that can be used.

2) Express

This is the next important library that most of my projects have. If my project has a need to serve web pages, I go with express and it is very comfortable for me to write APIs with the capabilities of the Express framework. I know for a fact that there are also other similar libraries available but I find myself very comfortable with express because I'm used to it.

3) Axios

This is the next important library that is used by people who access APIs in their projects. There are many competitive and good alternatives available but this is my choice because of the ease to work with them. It is also promise-based and undergoes regular updates.

4) Dotenv

This is the next most important library that I mostly use in my projects to load the configurations. When it is a backend API or a backend service we have to load the configurations to the application from a different location other than the project directory itself. I prefer keeping the variables in .env and push it to process.env with the help of dotenv library. This is a very good utility for developers when it comes to security.

5) Helmet

This is the next important library that I would say is a mandatory one for APIs. This adds more security to the APIs by adding appropriate headers. If we are using Express in our project and especially serving API endpoints in our app, I would strongly recommend having Helmet by default.

I keep looking for similar libraries for my projects. For me, learning happens every single day and I keep discovering some good package every time I look for it. Another best thing is to check some existing projects or open-source projects. Sometimes when we check open-source projects, we end up finding out a great package that would be very useful for our projects as well. Discovery becomes easier.



Posted with STEMGeeks

4
$ 1.92
$ 1.92 from @TheRandomRewarder
Avatar for bala41288
3 years ago

Comments