/bin-version-sync

Get the version of a binary in semver format

Primary LanguageJavaScriptMIT LicenseMIT

Synchronously get the version of a binary in semver format. Modified from sindresorhus/bin-version

Install

$ npm install bin-version-sync

Usage

$ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0)
const binVersion = require('bin-version-sync');

console.log(binVersion('curl'));
//=> '7.30.0'
$ openssl version
OpenSSL 1.0.2d 9 Jul 2015
console.log(binVersion('openssl', {args: ['version']}));
//=> '1.0.2'

Related

License

MIT © Sindre Sorhus MIT © Loren Bell