Skip to content

Instantly share code, notes, and snippets.

@a0viedo
Created September 4, 2014 17:40
Show Gist options
  • Save a0viedo/d24247d710287fdf31bc to your computer and use it in GitHub Desktop.
Save a0viedo/d24247d710287fdf31bc to your computer and use it in GitHub Desktop.
using npm programmatically
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