A streaming wrapper around isaac’s “which” that adds support for arrays of executables.
whiches is essentially a streaming wrapper around isaacs’s which that adds support for arrays of executables.
npm install whiches
var whiches = require'whiches'whiches'vlc'pipeprocessstdout// => /usr/bin/vlcwhiches'chromium' 'node'pipeprocessstdout// => /usr/bin/chromium// /usr/bin/nodewhiches'fakeprogram' 'node' 'anotherfakeprogram'pipeprocessstdout// => /usr/bin/node
Each path that whiches outputs ends with a new line character, so stream consumers will want to be aware of that.