Use NPM download nodejs packages

NPM is a package manager for Node.js packages

Example: use module upper-case

1. Download module upper-case with npm

Run cmd:

 

C:\Nodejs>npm install upper-case

 

2. uppercase.js

 

var http = require('http');

var uc = require('upper-case');

var textUp = uc("Hello World!");

console.log(textUp);

 

Run program via cmd:

 

C:\Nodejs>node uppercase.js

 

Output:

 

HELLO WORLD!