Created
August 14, 2015 17:49
-
-
Save blakek/e3a18e0de13165f4719d to your computer and use it in GitHub Desktop.
Install packages using npm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var npm = require('npm'); | |
function npm_ready (err) { | |
if (err) { | |
console.log(err); | |
} | |
console.log('Searching...'); | |
npm.commands.search(['wa-source-'], false, function (err, data) { | |
console.log('Search done.'); | |
if (err) { | |
console.log(err); | |
} | |
console.log('Installing...'); | |
npm.commands.install(__dirname + '/test', Object.keys(data), function (e, data) { | |
console.log('Install done.'); | |
console.log('Error:'); | |
console.log(e); | |
console.log('Data:'); | |
console.log(data); | |
}); | |
}); | |
} | |
npm.load(npm_ready); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment