# bin-version-check

> Check whether a binary version satisfies a semver range

Latest version **6.0.0** (published 2024-04-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install bin-version-check
pnpm add bin-version-check
yarn add bin-version-check
bun add bin-version-check
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2024-04-03 |
| First published | 2014-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | cli, binary, executable, version, semver, semantic, range, satisfy, check, validate |

## Links

- npm: https://www.npmjs.com/package/bin-version-check
- Repository: https://github.com/sindresorhus/bin-version-check
- Homepage: https://github.com/sindresorhus/bin-version-check#readme
- Issues: https://github.com/sindresorhus/bin-version-check/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/bin-version-check

## Dependencies (3)

- [semver](https://npm.io/package/semver.md) ^7.6.0
- [binary-version](https://npm.io/package/binary-version.md) ^7.1.0
- [semver-truncate](https://npm.io/package/semver-truncate.md) ^3.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 6.0.0 (latest) — 2024-04-03
- 5.1.0 — 2023-06-25
- 5.0.0 — 2021-04-28
- 4.0.0 — 2018-11-06
- 3.0.0 — 2015-12-12
- 2.1.0 — 2014-10-07
- 2.0.0 — 2014-10-03
- 1.0.0 — 2014-08-29
- 0.1.0 — 2014-06-14

## README

# bin-version-check

> Check whether a binary version satisfies a [semver range](https://github.com/npm/node-semver#ranges)

Useful when you have a thing that only works with specific versions of a binary.

## Install

```sh
npm install bin-version-check
```

## Usage

```console
$ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0)
```

```js
import binaryVersionCheck from 'bin-version-check';

try {
	await binaryVersionCheck('curl', '>=8');
} catch (error) {
	console.log(error);
	//=> 'InvalidBinaryVersion: curl 7.30.0 doesn't satisfy the version requirement of >=8'
}
```

## API

### binaryVersionCheck(binary, semverRange, options?)

#### binary

Type: `string`

Name or path of the binary to check.

#### semverRange

Type: `string`

[Semver range](https://github.com/npm/node-semver#ranges) to check against.

#### options

Type: `object`

##### args

Type: `string[]`\
Default: `['--version']`

CLI arguments used to get the binary version.

## Related

- [bin-version-check-cli](https://github.com/sindresorhus/bin-version-check-cli) - CLI for this module

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