Node.js NPM Modules
Node.js Tutorial » Node.js NPM Modules
What is NPM Modules?
NPM is a package manager for the Node.js packages or modules you want.
You can find hundreds of free packages on www.npmjs.com to download and use for what you need.
When you install node js the NPM packages are already on your computer.
What is a Package NPM?
An NPM package in Node.js contains all the files when you need a module.
Modules are JavaScript libraries that you can include in your project.
Installing Modules using NPM
Simple syntax to install any module Node.js
For example, following is the command to install a famous Node.js web framework module called express
Now you can use this module in your js file as following −
Related subjects:
node.js http module
node.js modules
global objects nodejs
Tags: nodejs npm install, version table, start, package, init, build, run build, tutorial, Node Package Manager
What is npm and Nodejs?
Does npm come with Nodejs?
How install Node JS npm Linux?
Download a Package
Downloading a package is very easy way.
To make the download possible open the command line interface choose the desired package and tell NPM to download.
As an example, download a package called "upper-case":
In this way you have downloaded and installed the first package called "upper-case"!
NPM itself creates a folder named "node_modules", where the package will be placed. All packages you install in the future will be placed in this "node_modules" folder.
Your project now has a folder structure like this:
E:\Users\My_Name\node_modules\upper-case
How to use a Package
Once the package has been installed, it is ready to use.
Let's use the "upper-case" package once downloaded, and the other modules can be installed in the same way and inserted in the same directory.
Let's create a Node.js file that will convert the result "Hi, this is a script" into upper-case letters.
var uc = require('upper-case');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(uc.upperCase("Hi, this is a script"));
res.end();
}).listen(8888);
We save the above code to a file named "demo_test_upper-case.js" and start the file:
nodejs npm install, version table, start, package, init, build, run build, tutorial, Node Package Manager
What is npm and Nodejs?
Does npm come with Nodejs?
How install Node JS npm Linux?
Node.js NPM Modules - nodejs
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.