Socket
Socket
Sign inDemoInstall

bin-version-check

Package Overview
Dependencies
4
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bin-version-check

Check whether a binary version satisfies a semver range


Version published
Weekly downloads
1.4M
decreased by-20.51%
Maintainers
1
Install size
780 kB
Created
Weekly downloads
 

Package description

What is bin-version-check?

The bin-version-check npm package is designed to check if the version of a binary meets the specified semver range. It is particularly useful for ensuring that the versions of dependencies or tools used in your project meet certain version criteria, helping to avoid compatibility issues or leveraging specific features available only in certain versions.

What are bin-version-check's main functionalities?

Version Checking

This feature allows you to check if the installed version of a binary (e.g., curl) meets a specified semver range. The code sample demonstrates how to check if the version of curl is greater than or equal to 7.30.0.

const binVersionCheck = require('bin-version-check');

binVersionCheck('curl', '>= 7.30.0').then(() => {
  console.log('Valid version');
}).catch(error => {
  console.error('Incompatible version', error);
});

Other packages similar to bin-version-check

Readme

Source

bin-version-check Build Status

Check whether a binary version satisfies a semver range

Useful when you have a thing that only works with specific versions of a binary.

Install

$ npm install --save bin-version-check

Usage

$ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0)
var binVersionCheck = require('bin-version-check');

binVersionCheck('curl', '>=8', function (err) {
	if (err) {
		throw err;
		//=> InvalidBinVersion: curl 7.30.0 does not satisfy the version requirement of >=8
	}
});

CLI

$ npm install --global bin-version-check
$ bin-version-check --help

  Usage
    bin-version-check <binary> <semver-range>

  Example
    $ curl --version
    curl 7.30.0 (x86_64-apple-darwin13.0)
    $ bin-version-check curl '>=8'
    curl 7.30.0 does not satisfy the version requirement of >=8

  Exits with code 0 if the semver range is satisfied and 1 if not

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 07 Oct 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc