npm.io
8.2.2 • Published 2 months ago

@xhmikosr/bin-check

Licence
MIT
Version
8.2.2
Deps
2
Size
4 kB
Vulns
0
Weekly
0

@xhmikosr/bin-check npm version CI Status

Check if a binary is working by checking its exit code

Install

npm install @xhmikosr/bin-check

Usage

import binCheck from '@xhmikosr/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

Keywords