find-exec
v1.0.0 find executable shell minimalistic command line
find-exec
Takes a list of shell commands and returns the first available. Works synchronously to respect the order.
Returns null
if none of the listed commands were found.
Examples
$ which mplayer
which: no mplayer
$ which afplay
/usr/bin/afplay
var command = require('find-exec')(["mplayer", "afplay", "cvlc"])
console.log(command) // afplay
var command = require('find-exec')(["mplayer"])
console.log(command) // null
Installation
npm install find-exec
License
MIT
npm i [email protected]
Metadata
- MIT
- Whatever
- Hrvoje Simic
- released 10/24/2016