Package Exports
- multiwhich
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (multiwhich) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
multiwhich
node-which with multi-executable support: finds the first instance of a specified executable in the PATH environment variable.
const multiwhich = require('multiwhich');
multiwhich(['ls', 'mkdir'], (err, paths) {
if (err) {
throw err;
}
paths; ['/bin/ls', '/bin/mkdir']
});
Installation
npm install multiwhich
API
const multiwhich = require('multiwhich');
multiwhich(cmds [, options], callback)
cmds: Array
of strings
options: Object
(used as node-which options)
callback: Function
The API is almost the same as node-which
's, except for:
- It receives an array of executable names as its first argument.
- It passes an array of the resolved executable paths to the callback function.
const multiwhich = require('multiwhich');
multiwhich(['eslint', 'tape'], {path: 'node_modules/.bin/'}, (err, paths) => {
if (err) {
throw err;
}
paths:
//=> ['/Users/yourname/project/node_modules/.bin/eslint', '/Users/yourname/project/node_modules/.bin/eslint']
});
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.