Created
September 4, 2014 17:40
-
-
Save a0viedo/d24247d710287fdf31bc to your computer and use it in GitHub Desktop.
using npm programmatically
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'); | |
npm.load(function(err, npm){ | |
npm.config.set('loglevel', 'silent'); | |
npm.commands.show(['npm'], function(err, result){ /* not using any result on purpose*/}); | |
console.log(npm.config.get('loglevel')); // this is printing 'silent' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment