15 1 / 2012

Node Package.json

Node handles dependencies pretty cool, within your node application go ahead and add a file called packages.json

Once this file is created go ahead and paste this sample inside

{

  “name”: “Sample Project”,

  “version” : “1.0.0”,

  “description”: “Need Dependancies”,

  “author”: “Your Name”,

  “dependencies”: {

  “express”: “2.5.6”,

  “express-mongoose”: “0.0.4”,

  “swig”: “0.8.0”,

  “socket.io”: “0.8.7”

  },

  “engine”: “node >= 0.4.12”

}

Now if you have npm installed with node, open your console to your in the app folder and type

npm install

By doing so, npm will install all the packages within the dependency list, for more info, check our the official npm site

http://npmjs.org/doc/json.html