Socket
Socket
Sign inDemoInstall

bin-version-check

Package Overview
Dependencies
27
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.9M
increased by1.23%
Maintainers
1
Install size
458 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

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 bin-version-check

Usage

$ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0)
import binaryVersionCheck from 'bin-version-check';

try {
	await binaryVersionCheck('curl', '>=8');
} catch (error) {
	console.log(error);
	//=> 'InvalidBinaryVersion: curl 7.30.0 doesn't satisfy the version requirement of >=8'
}

API

binaryVersionCheck(binary, semverRange, options?)

binary

Type: string

Name or path of the binary to check.

semverRange

Type: string

Semver range to check against.

options

Type: object

args

Type: string[]
Default: ['--version']

CLI arguments used to get the binary version.

Keywords

FAQs

Last updated on 03 Apr 2024

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