bin-version-check

WebJar for bin-version-check

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

bin-version-check
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

bin-version-check
WebJar for bin-version-check
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/bin-version-check

Download bin-version-check

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/bin-version-check/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>bin-version-check</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/bin-version-check/
implementation 'org.webjars.npm:bin-version-check:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/bin-version-check/
implementation ("org.webjars.npm:bin-version-check:2.1.0")
'org.webjars.npm:bin-version-check:jar:2.1.0'
<dependency org="org.webjars.npm" name="bin-version-check" rev="2.1.0">
  <artifact name="bin-version-check" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='bin-version-check', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "bin-version-check" % "2.1.0"
[org.webjars.npm/bin-version-check "2.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : bin-version jar [1.0.0,2)
org.webjars.npm : minimist jar [1.1.0,2)
org.webjars.npm : semver jar [4.0.3,5)
org.webjars.npm : semver-truncate jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

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.

Related

Versions

Version
2.1.0