5 Essential NPM Packages You Must Know

Node packages you need every day

Shoaib Mehedi
Mar 21 · 3 min read
Photo by Avinash Murugappan on Unsplash

Every scalable project should meet some criteria. So I am going to describe the best practices.

Playing with time and array is mandatory in every system.

A system without a logger is a headache, and it is almost impossible to maintain if there any error occurs.

We also need middleware and one last thing is automated test.

Every point I mentioned is mandatory for large/small systems. Sometimes we do it from scratch, but I think this is a waste of time. Some npm packages have great support with these features, and it is reliable, stable and easy to use.

1. Moment — Time manipulation

javascript time management
javascript time management
Photo by Sonja Langford on Unsplash

I think handling time management (timezone, date, month, format, etc.)is the most common and hassle in a system. The Moment is one of the most stable & maintained time manipulation library. The whole collection of libraries, created to solve the issues of formatting, parsing, converting, and, generally, working with different forms of time, Moment.js is the one that has seen the widest adoption. Here is the reference.

2. Winston — logger tool

javascript logger
javascript logger
Logger sample

For reporting, the system should have a logger and winston is better for this. Winston is very powerful and easy to use. Logger helps to debug from the previous report. Store log file as JSON is standard, and I think this is helpful because JSON is more flexible to go through the script for finding the desired report. Just go to the link and have a look.

3. Loadash

The most popular and widely used library for playing with array loadash is popular. A huge number of projects and library depends on it.

Lodash makes JavaScript easier by taking the hassle out of working with arrays, numbers, objects, strings, etc. Lodash’s modular methods are great for:

  • Iterating arrays, objects, & strings
  • Manipulating & testing values
  • Creating composite functions

4. Mocha

javascript test
javascript test
Photo by Scott Graham on Unsplash

Mocha is the most powerful testing tool in node.js widely used for test. It makes asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting while mapping uncaught exceptions to the correct test cases. Just pass your input and desired value and it will return you the result.

Mocha test case


5. Morgan

Morgan is the most popular HTTP request logger middleware for node.js.

Morgan functions take 3 arguments token, req, and res, where a token is an object with all defined tokens, req is the HTTP request, and res is the response. The function is expected to return a string that will be the log line, undefined, or null to skip logging.


Obviously, you need all of these in your day-to-day life if you are a programmer, and having these concepts can help you to release your pain.

Have a great day!

Coders Equity

Get updated that you are interested in.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store