# @lesjoursfr/bin-version

> Get the version of a binary in semver format

Latest version **8.1.3** (published 2026-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lesjoursfr/bin-version
pnpm add @lesjoursfr/bin-version
yarn add @lesjoursfr/bin-version
bun add @lesjoursfr/bin-version
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.1.3 |
| Published | 2026-10-08 |
| First published | 2023-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | 22.x \|\| 24.x \|\| 26.x |
| Dependencies | 2 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Sindre Sorhus |
| Maintainers | e-adrien |
| Keywords | binary, executable, version, semver, semantic, cli |

## Links

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

## Dependencies (2)

- [execa](https://npm.io/package/execa.md) ^10.0.1
- [find-versions](https://npm.io/package/find-versions.md) ^6.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

- 8.1.3 (latest) — 2026-10-08
- 8.1.2 — 2026-07-01
- 8.1.1 — 2026-05-04
- 8.1.0 — 2026-04-24
- 8.0.5 — 2026-03-02
- 8.0.4 — 2026-02-13
- 8.0.3 — 2026-01-22
- 8.0.2 — 2026-01-06
- 8.0.1 — 2025-12-01
- 8.0.0 — 2025-10-28
- 7.1.10 — 2025-09-16
- 7.1.9 — 2025-04-02
- 7.1.8 — 2025-01-02
- 7.1.7 — 2024-12-04
- 7.1.6 — 2024-08-01
- … 7 more at https://npm.io/package/@lesjoursfr/bin-version/versions

## README

[![npm version](https://badge.fury.io/js/@lesjoursfr%2Fbin-version.svg)](https://badge.fury.io/js/@lesjoursfr%2Fbin-version)
[![QC Checks](https://github.com/lesjoursfr/bin-version/actions/workflows/quality-control.yml/badge.svg)](https://github.com/lesjoursfr/bin-version/actions/workflows/quality-control.yml)

# bin-version

Get the version of a binary in [semver](https://github.com/npm/node-semver) format

## Install

```sh
npm install @lesjoursfr/bin-version
```

## Usage

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

```js
import binaryVersion from "@lesjoursfr/bin-version";

console.log(await binaryVersion("curl"));
//=> '7.30.0'
```

```sh
openssl version
OpenSSL 1.0.2d 9 Jul 2015
```

```js
import binaryVersion from "@lesjoursfr/bin-version";

console.log(await binaryVersion("openssl"));
//=> '1.0.2'
```

```sh
openssl version
OpenSSL 1.0.2d 9 Jul 2015
```

```js
import binaryVersion from "@lesjoursfr/bin-version";

console.log(await binaryVersion("openssl", { args: ["version"] }));
//=> '1.0.2'
```

## API

### binaryVersion(binary, options?)

Returns a `Promise<string>` with the version of the `binary`.

#### binary

Type: `string`

The name of or path to the binary to get the version from.

#### options

Type: `object`

##### args

Type: `string[]`

The arguments to pass to `binary` so that it will print its version.

If not specified, predefined arguments will be used for known binaries, or `['--version']` and `['version']` arguments will be tried.

## Related

- [find-versions](https://github.com/sindresorhus/find-versions) - Find semver versions in a string

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