Socket
Socket
Sign inDemoInstall

bin-version-check

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-version-check - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

16

index.js

@@ -6,5 +6,5 @@ 'use strict';

module.exports = (bin, semverRange, opts) => {
if (typeof bin !== 'string' || typeof semverRange !== 'string') {
return Promise.reject('`binary` and `semverRange` required');
module.exports = (binary, semverRange, options) => {
if (typeof binary !== 'string' || typeof semverRange !== 'string') {
return Promise.reject(new Error('`binary` and `semverRange` arguments required'));
}

@@ -16,9 +16,9 @@

return binVersion(bin, opts).then(binVersion => {
if (!semver.satisfies(semverTruncate(binVersion, 'patch'), semverRange)) {
const err = new Error(`${bin} ${binVersion} doesn't satisfy the version requirement of ${semverRange}`);
err.name = 'InvalidBinVersion';
throw err;
return binVersion(binary, options).then(binaryVersion => {
if (!semver.satisfies(semverTruncate(binaryVersion, 'patch'), semverRange)) {
const error = new Error(`${binary} ${binaryVersion} doesn't satisfy the version requirement of ${semverRange}`);
error.name = 'InvalidBinaryVersion';
throw error;
}
});
};
{
"name": "bin-version-check",
"version": "3.0.0",
"description": "Check whether a binary version satisfies a semver range",
"license": "MIT",
"repository": "sindresorhus/bin-version-check",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"cli",
"bin",
"binary",
"executable",
"version",
"semver",
"semantic",
"range",
"satisfy",
"check",
"validate"
],
"dependencies": {
"bin-version": "^2.0.0",
"semver": "^5.1.0",
"semver-truncate": "^1.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
},
"xo": {
"esnext": true
}
"name": "bin-version-check",
"version": "4.0.0",
"description": "Check whether a binary version satisfies a semver range",
"license": "MIT",
"repository": "sindresorhus/bin-version-check",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"cli",
"bin",
"binary",
"executable",
"version",
"semver",
"semantic",
"range",
"satisfy",
"check",
"validate"
],
"dependencies": {
"bin-version": "^3.0.0",
"semver": "^5.6.0",
"semver-truncate": "^1.1.2"
},
"devDependencies": {
"ava": "^1.0.0-rc.1",
"xo": "^0.23.0"
}
}

@@ -11,3 +11,3 @@ # bin-version-check [![Build Status](https://travis-ci.org/sindresorhus/bin-version-check.svg?branch=master)](https://travis-ci.org/sindresorhus/bin-version-check)

```
$ npm install --save bin-version-check
$ npm install bin-version-check
```

@@ -26,6 +26,10 @@

binVersionCheck('curl', '>=8').catch(err => {
throw err;
(async () => {
try {
await binVersionCheck('curl', '>=8');
} catch (error) {
console.log(error);
//=> 'InvalidBinVersion: curl 7.30.0 doesn't satisfy the version requirement of >=8'
});
}
})();
```

@@ -52,5 +56,7 @@

Type: `Object`
##### args
Type: `array`
Type: `string[]`
Default: `['--version']`

@@ -68,2 +74,2 @@

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)

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