npm-bin

Easily call local NPM binaries

npm install npm-bin
5 downloads in the last week
39 downloads in the last month

npmBin

Easily call local NPM binaries

When using ShellJS, you can write:

var npmBin = require('npm-bin');
var config = 'karma.conf.js';

npmBin('karma', [config, 'start']);

instead of:

var config = 'karma.conf.js';
exec('node_modules/.bin/karma ' + config + ' start');

You can also pass in environment variables:

var npmBin = require('npm-bin');

var config = 'karma.conf.js';
var envs = {
    'PHANTOMJS_BIN': '/opt/phantomjs/bin/phantomjs'
}

npmBin('karma', [config, 'start'], { envs: envs });
npm loves you