Get path of npm bin directory for executing locally and globally
$ npm install --save npm-bin-path
const npmBinPath = require('npm-bin-path');
npmBinPath().then(p => {
//=> ['./node_modules/.bin', '/.nvm/versions/node/v4.1.2/bin']
});
returns array of npm paths.
MIT © ragingwind