NodeJS package

How to include module

Use require method, and retrieve as object

var http = require('http');
var fs = require('fs');

How to install module

If missing package in your node default, you need to install package using npm

npm install ejs

You module will be installed under your project node_modules.

Global install

npm install -g mongoose

In that case, software is under /usr/local/lib/node_moduels

forever

package : process as daemon
also provides command

npm install -g forever

start forever

forever start app.js

stop forever

forever stop app.js

Useful Modules

  • http
  • HTTP Server etc…

  • fs
  • File operation object

  • url
  • URL operation object

  • ejs
  • HTML like Template Engine. Read template, Replace var and Render