download and use node.js NPM packages

How to Download and use Node.js NPM Packages


Let first define a few terms before we go deep into Node.js NPM Packages tutorial.

Define terms

What is NPM?

NPM stands for Node.js Package manager.NPM manages thousands of modules which are hosted in Some packages are free to use while others are restricted.

 Installing Node.js  will automatically install NPM.You can also write your own packages and make them accessible to all developers by packaging them in NPM.

What is a Package?

These are all the files that are needed for a certain module.

What is a Module?

Modules are JavaScript libraries that can be included in a project.

Top 5 most used Node.js NPM Packages.

Do you know that NPM is the world largest software registry with more than 3 billion downloads per week? This tells you how popular is Node.js.NPM contains over 600,000 packages of code blocks. Below are top 5 most used Node.js NPM Packages.

express.js is a web application server framework that is popular because its fast, robust and focuses on high performance.


The main use of body-parser is to parse incoming request bodies to middleware before handlers. It’s under req.body property.

Body Parser has the following modules.

  • JSON body parser

  • Raw body parser

  • Text body parser

  • URL-encoded form body parser


Lodash package makes it easier for node.js developers to work with arrays, objects, and strings. Lodash methods can be used in iterating arrays, objects or strings.


babel-core is popular javascript transpiler. Main use is converting ES6 to ES5, JSX to JavaScript, and Flow to JavaScript.


async is a module that is used to work with asynchronous JavaScript.It provides powerful and straightforward functions.

Downloading NPM Package.

Here are steps to download and install the NPM Package. First, create a new project by initializing it using “npm init” command. A  package.json file will be created, otherwise, if we try to download the package without JSON file error will pop up.

Create Project

Download upper-case package

  • Download upper-case node.js package

A quick look at the project folder.

Node.js project folder

Using Node.js upper-case package

Create an index.js file and use node.js upper-case package. Write below code.


upper case node.js package

Other cases packages  and is-lower-case

The is-upper-case method is used to check if the string is in upper case format and is-lower-case is used to check if a string is in lower case. The return type of both methods is boolean.

Download is-upper-case and is-lower-case packages in your project. Open visual studio and write below code.


is-lower-case and is-upper-case node.js methods

If we change the var str=“i love programming in node.js” which is a lower case string, below is output.

node.js check if a string is upper case or lower case


Use to convert the first character to upper-case and other characters to lower-case. To install title-case in your project enter

Using title-case


node.js tittle case example
How to use node.js tittle case


Used to header case a string.

Installing header-case




Used to lowercase the first character in a string.


Used to uppercase the first character in a string.

Used to dot case a string.




More cases to check out.

That all about  Node.js NPM Packages tutorial.Don’t forget to  share.

Related Node.js Articles.

How to use Node.js Url Module to route application using url.pathname