Top node.js modules to learn

Top node.js modules to learn
0.0 0

#1

In the FCC curriculum, I have learned express, multer and some other packages. What all packages are useful for in day to day work?


#2

One of my favourite things about using Node is the ease at which I can find and use good libraries. Normally it is as simple as a quick google search, then scanning for something with a high number of stars / downloads, and finally checking out the github link for basic documentation and issues. Since this is so fluid I find myself using new packages all the time.

The packages that a project needs really depends on what that project is so I wouldn’t invest a lot of time in learning a lot of them without a specific purpose. Keep in mind that the whole point of them is to make general problems easier, so good libraries are usually well documented and straight forward to use.


#3

I find myself reaching for express-session frequently. I tend to combine it with connect-redis because I happen to like Redis a lot, but judging by the github stars, it’s also the most popular option by a huge margin.


#4

Some packages I have come to love:

Passport is great for authentication, either by usual username/passport or through different strategies like Facebook/Twitter etc.

Body-parser I use all the time for making POST requests and works very well with express.

Nodemon automatically resets your server everytime you save, great for when ur working on back-date code.

Mongoose is a nicer alternative to the standard MongoDB Node driver, it’s based on structured schemas and is much easier to work with.

Socket.io is an extensive but easy to learn Websocket library. ws is a smaller alternative but more low-level than socket.io

Morgan is a server logger to log just about any piece of info you could need about your server

Isomorphic-fetch let’s you use the fetch API on both client and server, and is a much nicer API for Ajax calls than the regular XMLHttp object.

Chalk let’s you change the color of the text you log to your terminal, like red text for errors, green for passing tests etc. (Colors is also popular, but I wouldn’t recommend it, it does some destructive things to your terminal to get the same effect.