I would like to create a function that can return the result by npm test.
(by call this function npm.commands.test(packages, callback) https://docs.npmjs.com/api/test)
I tried to use that like this:
var npm = require("npm");
npm.load('', function(err, npm) {
npm.commands.test('package.json', function(data) {
});
});
It could run such as command npm test, but I don't know how to get the result? and what is the callback function like?