Synchronously get the version of a binary in semver format. Modified from sindresorhus/bin-version
$ npm install bin-version-sync
$ 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'
- [bin-version] (https://github.com/sindresorhus/bin-version) - Original async version
- bin-version-cli - CLI for async module
- find-versions - Find semver versions in a string
MIT © Sindre Sorhus MIT © Loren Bell