Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bin-version

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-version - npm Package Compare versions

Comparing version 5.0.0 to 6.0.0

45

index.d.ts

@@ -1,10 +0,8 @@

declare namespace binVersion {
interface Options {
/**
The arguments to pass to `binary` so that it will print its version.
export interface Options {
/**
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.
*/
readonly args?: readonly string[];
}
If not specified, predefined arguments will be used for known binaries, or `['--version']` and `['version']` arguments will be tried.
*/
readonly args?: readonly string[];
}

@@ -20,27 +18,20 @@

```
import binVersion = require('bin-version');
import binaryVersion from 'bin-version';
(async () => {
// $ curl --version
// curl 7.30.0 (x86_64-apple-darwin13.0)
// $ curl --version
// curl 7.30.0 (x86_64-apple-darwin13.0)
console.log(await binVersion('curl'));
//=> '7.30.0'
console.log(await binaryVersion('curl'));
//=> '7.30.0'
// $ openssl version
// OpenSSL 1.0.2d 9 Jul 2015
// $ openssl version
// OpenSSL 1.0.2d 9 Jul 2015
console.log(await binVersion('openssl'));
//=> '1.0.2'
console.log(await binaryVersion('openssl'));
//=> '1.0.2'
console.log(await binVersion('openssl', {args: ['version']}));
//=> '1.0.2'
})();
console.log(await binaryVersion('openssl', {args: ['version']}));
//=> '1.0.2'
```
*/
declare function binVersion(
binary: string,
options?: binVersion.Options
): Promise<string>;
export = binVersion;
export default function binaryVersion(binary: string, options?: Options): Promise<string>;

9

index.js

@@ -1,4 +0,3 @@

'use strict';
const execa = require('execa');
const findVersions = require('find-versions');
import execa from 'execa';
import findVersions from 'find-versions';

@@ -21,3 +20,3 @@ const oneMegabyte = 1000 * 1000;

module.exports = async (binary, options = {}) => {
export default async function binaryVersion(binary, options = {}) {
let possibleArguments;

@@ -58,2 +57,2 @@

throw new Error(`Couldn't find version of \`${binary}\``);
};
}
{
"name": "bin-version",
"version": "5.0.0",
"version": "6.0.0",
"description": "Get the version of a binary in semver format",

@@ -13,4 +13,6 @@ "license": "MIT",

},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=10"
"node": ">=12"
},

@@ -25,3 +27,2 @@ "scripts": {

"keywords": [
"bin",
"binary",

@@ -36,9 +37,9 @@ "executable",

"execa": "^5.0.0",
"find-versions": "^4.0.0"
"find-versions": "^5.0.0"
},
"devDependencies": {
"ava": "^2.4.0",
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.37.1"
"xo": "^0.39.1"
}
}

@@ -19,8 +19,6 @@ # bin-version

```js
const binVersion = require('bin-version');
import binaryVersion from 'bin-version';
(async () => {
console.log(await binVersion('curl'));
//=> '7.30.0'
})();
console.log(await binaryVersion('curl'));
//=> '7.30.0'
```

@@ -34,8 +32,6 @@

```js
const binVersion = require('bin-version');
import binaryVersion from 'bin-version';
(async () => {
console.log(await binVersion('openssl'));
//=> '1.0.2'
})();
console.log(await binaryVersion('openssl'));
//=> '1.0.2'
```

@@ -49,8 +45,6 @@

```js
const binVersion = require('bin-version');
import binaryVersion from 'bin-version';
(async () => {
console.log(await binVersion('openssl', {args: ['version']}));
//=> '1.0.2'
})();
console.log(await binaryVersion('openssl', {args: ['version']}));
//=> '1.0.2'
```

@@ -60,3 +54,3 @@

### binVersion(binary, options?)
### binaryVersion(binary, options?)

@@ -63,0 +57,0 @@ Returns a `Promise<string>` with the version of the `binary`.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc