A streaming wrapper around isaac’s “which” that adds support for arrays of executables.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
index.js
package.json
readme.md

readme.md

whiches

whiches is essentially a streaming wrapper around isaacs’s which that adds support for arrays of executables.

Install

npm install whiches

Example

var whiches = require('whiches')

whiches('vlc')
  .pipe(process.stdout)

// => /usr/bin/vlc

whiches(['chromium', 'node'])
  .pipe(process.stdout)

// => /usr/bin/chromium
//    /usr/bin/node 

whiches(['fakeprogram', 'node', 'anotherfakeprogram'])
  .pipe(process.stdout)

// => /usr/bin/node

Note

Each path that whiches outputs ends with a new line character, so stream consumers will want to be aware of that.

License

MIT