https://github.com/kevva/bin-check
Check if a binary is working by checking its exit code
https://github.com/kevva/bin-check
binary check executable nodejs
Last synced: 9 months ago
JSON representation
Check if a binary is working by checking its exit code
- Host: GitHub
- URL: https://github.com/kevva/bin-check
- Owner: kevva
- License: mit
- Created: 2014-02-07T09:10:24.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T17:14:09.000Z (over 5 years ago)
- Last Synced: 2025-07-07T12:07:50.448Z (9 months ago)
- Topics: binary, check, executable, nodejs
- Language: JavaScript
- Homepage:
- Size: 302 KB
- Stars: 13
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# bin-check [](https://travis-ci.org/kevva/bin-check)
> Check if a binary is working by checking its exit code
## Install
```
$ npm install bin-check
```
## Usage
```js
const binCheck = require('bin-check');
binCheck('/bin/sh', ['--version']).then(works => {
console.log(works);
//=> true
});
```
## API
### binCheck(binary, [arguments])
Returns a `Promise` for a `boolean`.
### binCheck.sync(binary, [arguments])
Returns a `boolean`.
#### binary
Type: `string`
Path to the binary.
#### arguments
Type: `Array`
Default: `['--help']`
Arguments to run the binary with.
## License
MIT © [Kevin Mårtensson](https://github.com/kevva)