An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# bin-check [![Build Status](https://travis-ci.org/kevva/bin-check.svg?branch=master)](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)