Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Created November 23, 2010 23:18
Show Gist options
  • Save ThisIsMissEm/712753 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/712753 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var fs = require("fs")
, path = require("path")
, npm = require("npm")
, readJSON = require("npm/utils/read-json");
npm.load(function(){
readJSON(process.argv[2], function(err, data){
if(err) throw err;
if(data["dependencies"]) {
var d = [];
Object.keys(data.dependencies).forEach(function (dep) {
d.push(dep+"@"+data.dependencies[dep])
});
npm.commands.install(d, function(){
console.log("done.");
process.exit(0);
});
} else {
process.exit(0);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment