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 4.0.0 to 5.0.0

24

index.js

@@ -5,4 +5,10 @@ 'use strict';

const oneMegabyte = 1000 * 1000;
const knownBinaryArguments = new Map([
...['ffmpeg', 'ffprobe', 'ffplay'].map(name => [name, ['-version']]),
...[
'ffmpeg',
'ffprobe',
'ffplay'
].map(name => [name, ['-version']]),
['openssl', ['version']]

@@ -21,7 +27,3 @@ ]);

const customArgs = knownBinaryArguments.get(binary);
if (customArgs === undefined) {
possibleArguments = defaultPossibleArguments;
} else {
possibleArguments = [customArgs];
}
possibleArguments = customArgs === undefined ? defaultPossibleArguments : [customArgs];
} else {

@@ -33,5 +35,9 @@ possibleArguments = [options.args];

try {
// TODO: Use `{all}` instead of `{stdout, stderr}` when execa v2 is out
const {stdout, stderr} = await execa(binary, args); // eslint-disable-line no-await-in-loop
const [version] = findVersions(stdout || stderr, {loose: true});
// eslint-disable-next-line no-await-in-loop
const {all} = await execa(binary, args, {
all: true,
maxBuffer: oneMegabyte
});
const [version] = findVersions(all, {loose: true});
if (version !== undefined) {

@@ -38,0 +44,0 @@ return version;

{
"name": "bin-version",
"version": "4.0.0",
"version": "5.0.0",
"description": "Get the version of a binary in semver format",
"license": "MIT",
"repository": "sindresorhus/bin-version",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},

@@ -32,10 +33,10 @@ "scripts": {

"dependencies": {
"execa": "^1.0.0",
"find-versions": "^3.0.0"
"execa": "^5.0.0",
"find-versions": "^4.0.0"
},
"devDependencies": {
"ava": "^2.1.0",
"tsd": "^0.7.3",
"xo": "^0.24.0"
"ava": "^2.4.0",
"tsd": "^0.14.0",
"xo": "^0.37.1"
}
}

@@ -1,6 +0,5 @@

# bin-version [![Build Status](https://travis-ci.com/sindresorhus/bin-version.svg?branch=master)](https://travis-ci.com/sindresorhus/bin-version)
# bin-version
> Get the version of a binary in [semver](https://github.com/npm/node-semver) format
## Install

@@ -12,3 +11,2 @@

## Usage

@@ -58,3 +56,2 @@

## API

@@ -84,3 +81,2 @@

## Related

@@ -87,0 +83,0 @@

Sorry, the diff of this file is not supported yet

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