Reputation: 1511
With a local installation of npm in ./node_modules/npm
and inside a default node
shell,
var npm = require('npm');
npm.load({}, function (err, res) {
npm.info('tennu');
}
the result of npm.info()
will echo to stdout
the same stuff that it would as if you called
npm info tennu
from the commandline.
How can I make npm not echo to stdout?
Upvotes: 0
Views: 54
Reputation: 17160
See npm apihelp info
require('npm').load({}, function (err, npm) {
npm.commands.info(['tennu', 'version'], true, function (er, info) {
console.error('the info was:', info)
})
})
Upvotes: 2