isaacs/npm — pull request #4320 by mikermcneil (2013-12-15 23:18:00+00:00)
Title: Patch for a hole in loglevel='silent' when using npm programmatically

#### Issue
When using `npm.commands.install` programmatically, a "pretty" `console.log` describing the installed modules is run, even when `config.loglevel=silent`.

Here's a simple test script which demonstrates the issue (modified from the example [here](https://github.com/isaacs/npm#using-npm-programmatically))
```javascript
var npm = require('npm');
npm.load({
registry: 'https://registry.npmjs.org',
loglevel: 'silent'
}, function(err) {
if (err) throw new Error(err);

npm.commands.install(['lodash'], function(err, data) {
// ...
});
});
```

#### Proposed Solution
Checks if `npm.config.loglevel === 'silent'`, and skips writing a log if it does.

@isaacs If there's another way you'd rather go about approaching this, I'm happy to-- just figured this was the intended behavior ( it's what I was expecting when I configured `silent`, at least ) Thanks!