Tuesday, April 9, 2013

Using npm modules


var foo = require('module-name')
var parser = require('node-markdown);

Under your project > node-modules > package.json

...
},
"dependencies" : {
"markdown": "0.1.0",
"module": "*",
},
...

loading local modules > data_module

//search for npm modules

$npm search | grep some-string
$npm search

//install a module

$cd folder
$npm install node-markdown

//setup project with npm

$cd Desktop/html
$npm init

//fill in and enter on each of the queries

//edit the package.json with all your modules info and run:

$npm install

$npm update  //update the modules
$sudo npm update -g  //run as sudo since global

$npm prune //remove modules in your project

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.