JackHQ

0 notes

NTS: NPM package.json format

Node Package Manger

Npm has a json config file that help defines the nodejs libraries for distribution. This package.json file can also be used in projects to document dependencies for your nodejs project. This short article is a note to self document on how to do this.

{
  "name": "Project Name",
  "description": "Project Description.",
  "version": "0.0.1",
  "homepage": "http://#",
  "author": "You",
  "private": true,
  "dependencies": {
    "express": "2.x",
    "connect": ">= 1.4",
    "log4js": ">= 0.2.5"
  },
  "engines": { "node": ">= 0.4.7" }
}
and to install the modules, use:

npm install .