https://github.com/shime/find-exec
Takes a list of shell commands and returns the first available.
https://github.com/shime/find-exec
Last synced: 11 months ago
JSON representation
Takes a list of shell commands and returns the first available.
- Host: GitHub
- URL: https://github.com/shime/find-exec
- Owner: shime
- License: mit
- Created: 2014-09-11T21:59:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-08-24T07:14:56.000Z (almost 3 years ago)
- Last Synced: 2025-04-10T16:46:50.030Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# find-exec
[](https://npmjs.org/package/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
```javascript
var command = require('find-exec')(["mplayer", "afplay", "cvlc"])
console.log(command) // afplay
```
```javascript
var command = require('find-exec')(["mplayer"])
console.log(command) // null
```
## Installation
npm install find-exec
## License
MIT