UNPKG

772 BMarkdownView Raw
1# bin-check [![Build Status](https://travis-ci.org/kevva/bin-check.svg?branch=master)](https://travis-ci.org/kevva/bin-check)
2
3> Check if a binary is working by checking its exit code
4
5
6## Install
7
8```
9$ npm install --save bin-check
10```
11
12
13## Usage
14
15```js
16var binCheck = require('bin-check');
17
18binCheck('/bin/sh', ['--version'], function (err, works) {
19 console.log(works);
20 //=> true
21});
22```
23
24
25## API
26
27### binCheck(binary, command, callback)
28
29#### binary
30
31Type: `string`
32
33Path to the binary.
34
35#### command
36
37Type: `array`
38Default: `['--help']`
39
40Commands to run the binary with.
41
42#### callback(err, works)
43
44Type: `function`
45
46`works` is a `boolean` which returns `true` if the binary is working correctly.
47
48
49## License
50
51MIT © [Kevin Mårtensson](https://github.com/kevva)