# @xhmikosr/bin-check

> Check if a binary is working

Latest version **8.2.2** (published 2026-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xhmikosr/bin-check
pnpm add @xhmikosr/bin-check
yarn add @xhmikosr/bin-check
bun add @xhmikosr/bin-check
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 8.2.2 |
| Published | 2026-06-22 |
| First published | 2023-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Mårtensson |
| Maintainers | xhmikosr |
| Keywords | binary, check, executable, test |

## Links

- npm: https://www.npmjs.com/package/@xhmikosr/bin-check
- Repository: https://github.com/XhmikosR/bin-check
- Homepage: https://github.com/XhmikosR/bin-check#readme
- Issues: https://github.com/XhmikosR/bin-check/issues
- npm.io page: https://npm.io/package/@xhmikosr/bin-check

## Dependencies (2)

- [execa](https://npm.io/package/execa.md) ^9.6.1
- [isexe](https://npm.io/package/isexe.md) ^4.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 8.2.2 (latest) — 2026-06-22
- 8.2.1 — 2026-02-28
- 8.2.0 — 2026-02-28
- 8.1.0 — 2026-02-24
- 8.0.0 — 2026-02-24
- 7.1.0 — 2025-07-22
- 7.0.3 — 2024-04-01
- 7.0.2 — 2024-04-01
- 7.0.1 — 2024-04-01
- 7.0.0 — 2024-04-01
- 6.0.0 — 2023-06-02
- 5.0.2 — 2023-06-01
- 5.0.1 — 2023-05-31
- 5.0.0 — 2023-05-31

## README

# @xhmikosr/bin-check [![npm version](https://img.shields.io/npm/v/@xhmikosr/bin-check?logo=npm&logoColor=fff)](https://www.npmjs.com/package/@xhmikosr/bin-check) [![CI Status](https://img.shields.io/github/actions/workflow/status/XhmikosR/bin-check/ci.yml?branch=master&label=CI&logo=github)](https://github.com/XhmikosR/bin-check/actions/workflows/ci.yml?query=branch%3Amaster)

> Check if a binary is working by checking its exit code


## Install

```sh
npm install @xhmikosr/bin-check
```


## Usage

```js
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](https://github.com/kevva)

---
_Source: https://npm.io/package/@xhmikosr/bin-check · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
