Call Download node app dependencies from another node application

i have a command tool application developed using node. when pointed over a folder when i run a command it should install the node dependencies specified in the package.json file in the folder. is it possible to do like this.

You need to use

 exec = require('child_process').exec;
 exec(#your command starts here

But in general you should do googling before asking questions: http://nodejs.org/api/child_process.html

also remember that user under which your tool is executed should have access rights to do so (e.g. root or destination folder owner)

PS: sorry for bad formatting and little text - typed from phone :)