bin-version

Get the version of a binary in semver format

Renamed to binary-version: https://www.npmjs.com/package/binary-version
Last updated 3 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install bin-version 
SYNC missed versions from official npm registry.

bin-version

Get the version of a binary in semver format

Install

npm install bin-version

Usage

$ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0)
import binaryVersion from 'bin-version';

console.log(await binaryVersion('curl'));
//=> '7.30.0'
$ openssl version
OpenSSL 1.0.2d 9 Jul 2015
import binaryVersion from 'bin-version';

console.log(await binaryVersion('openssl'));
//=> '1.0.2'
$ openssl version
OpenSSL 1.0.2d 9 Jul 2015
import binaryVersion from '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

Current Tags

  • 7.0.0                                ...           latest (3 years ago)

13 Versions

  • 7.0.0 [deprecated]           ...           3 years ago
  • 6.0.0                                ...           6 years ago
  • 5.0.0                                ...           6 years ago
  • 4.0.0                                ...           7 years ago
  • 3.1.0                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.0                                ...           11 years ago
  • 1.0.4                                ...           11 years ago
  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 27
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 0
Last Month 15
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE