22
33> Binary wrapper that makes your programs seamlessly available as local dependencies
44
5+
56## Install
67
7- ``` sh
8+ ```
89$ npm install --save bin-wrapper
910```
1011
12+
1113## Usage
1214
1315``` js
@@ -23,10 +25,6 @@ var bin = new BinWrapper()
2325 .version (' >=1.71' );
2426
2527bin .run ([' --version' ], function (err ) {
26- if (err) {
27- throw err;
28- }
29-
3028 console .log (' gifsicle is working' );
3129});
3230```
@@ -37,22 +35,23 @@ Get the path to your binary with `bin.path()`:
3735console .log (bin .path ()); // => path/to/vendor/gifsicle
3836```
3937
38+
4039## API
4140
42- ### new BinWrapper(opts )
41+ ### new BinWrapper(options )
4342
4443Creates a new ` BinWrapper ` instance.
4544
46- #### opts .skipCheck
45+ #### options .skipCheck
4746
48- Type: ` Boolean `
47+ Type: ` boolean `
4948Default: ` false `
5049
5150Whether to skip the binary check or not.
5251
53- #### opts .strip
52+ #### options .strip
5453
55- Type: ` Number `
54+ Type: ` number `
5655Default: ` 1 `
5756
5857Strip a number of leading paths from file names on extraction.
@@ -63,35 +62,35 @@ Adds a source to download.
6362
6463#### url
6564
66- Type: ` String `
65+ Type: ` string `
6766
6867Accepts a URL pointing to a file to download.
6968
7069#### os
7170
72- Type: ` String `
71+ Type: ` string `
7372
7473Tie the source to a specific OS.
7574
7675#### arch
7776
78- Type: ` String `
77+ Type: ` string `
7978
8079Tie the source to a specific arch.
8180
8281### .dest(dest)
8382
8483#### dest
8584
86- Type: ` String `
85+ Type: ` string `
8786
8887Accepts a path which the files will be downloaded to.
8988
9089### .use(bin)
9190
9291#### bin
9392
94- Type: ` String `
93+ Type: ` string `
9594
9695Define which file to use as the binary.
9796
@@ -103,7 +102,7 @@ Returns the full path to your binary.
103102
104103#### range
105104
106- Type: ` String `
105+ Type: ` string `
107106
108107Define a [ semver range] ( https://github.com/isaacs/node-semver#ranges ) to check
109108the binary against.
@@ -115,18 +114,19 @@ using the URL provided in `.src()`.
115114
116115#### cmd
117116
118- Type: ` Array `
117+ Type: ` array `
119118Default: ` ['--version'] `
120119
121120Command to run the binary with. If it exits with code ` 0 ` it means that the
122121binary is working.
123122
124123#### cb(err)
125124
126- Type: ` Function `
125+ Type: ` function `
127126
128127Returns nothing but a possible error.
129128
129+
130130## License
131131
132132MIT © [ Kevin Mårtensson] ( http://kevinmartensson.com )
0 commit comments