Initial commit
[yaffs-website] / node_modules / bin-version-check / readme.md
1 # bin-version-check [![Build Status](https://travis-ci.org/sindresorhus/bin-version-check.svg?branch=master)](https://travis-ci.org/sindresorhus/bin-version-check)
2
3 > Check whether a binary version satisfies a [semver range](https://github.com/isaacs/node-semver#ranges)
4
5 Useful when you have a thing that only works with specific versions of a binary.
6
7
8 ## Install
9
10 ```sh
11 $ npm install --save bin-version-check
12 ```
13
14
15 ## Usage
16
17 ```sh
18 $ curl --version
19 curl 7.30.0 (x86_64-apple-darwin13.0)
20 ```
21
22 ```js
23 var binVersionCheck = require('bin-version-check');
24
25 binVersionCheck('curl', '>=8', function (err) {
26         if (err) {
27                 throw err;
28                 //=> InvalidBinVersion: curl 7.30.0 does not satisfy the version requirement of >=8
29         }
30 });
31 ```
32
33
34 ## CLI
35
36 ```sh
37 $ npm install --global bin-version-check
38 ```
39
40 ```
41 $ bin-version-check --help
42
43   Usage
44     bin-version-check <binary> <semver-range>
45
46   Example
47     $ curl --version
48     curl 7.30.0 (x86_64-apple-darwin13.0)
49     $ bin-version-check curl '>=8'
50     curl 7.30.0 does not satisfy the version requirement of >=8
51
52   Exits with code 0 if the semver range is satisfied and 1 if not
53 ```
54
55
56 ## License
57
58 MIT © [Sindre Sorhus](http://sindresorhus.com)