Skip to content

Commit f2cb1b6

Browse files
committed
Update documentation
1 parent 898f259 commit f2cb1b6

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

readme.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,23 @@ console.log(bin.path()); // => path/to/vendor/gifsicle
4141

4242
### new BinWrapper(opts)
4343

44-
Creates a new `BinWrapper` instance. The available options are:
44+
Creates a new `BinWrapper` instance.
4545

46-
* `skipCheck`: Whether to skip checking if the binary works or not. Defaults to `false`.
47-
* `strip`: Strip a number of leading paths from file names on extraction. Defaults to `1`.
46+
#### opts.skipCheck
4847

49-
### .src(url, os, arch)
48+
Type: `Boolean`
49+
Default: `false`
50+
51+
Whether to skip the binary check or not.
52+
53+
#### opts.strip
54+
55+
Type: `Number`
56+
Default: `1`
57+
58+
Strip a number of leading paths from file names on extraction.
59+
60+
### .src(url, [os], [arch])
5061

5162
Adds a source to download.
5263

@@ -70,35 +81,42 @@ Tie the source to a specific arch.
7081

7182
### .dest(dest)
7283

84+
#### dest
85+
7386
Type: `String`
7487

7588
Accepts a path which the files will be downloaded to.
7689

7790
### .use(bin)
7891

92+
#### bin
93+
7994
Type: `String`
8095

8196
Define which file to use as the binary.
8297

8398
### .path()
8499

85-
Get the full path to your binary.
100+
Returns the full path to your binary.
86101

87102
### .version(range)
88103

104+
#### range
105+
89106
Type: `String`
90107

91108
Define a [semver range](https://github.com/isaacs/node-semver#ranges) to check
92109
the binary against.
93110

94-
### .run(cmd, cb)
111+
### .run([cmd], cb)
95112

96113
Runs the search for the binary. If no binary is found it will download the file
97114
using the URL provided in `.src()`.
98115

99116
#### cmd
100117

101-
Type: `Array`
118+
Type: `Array`
119+
Default: `['--version']`
102120

103121
Command to run the binary with. If it exits with code `0` it means that the
104122
binary is working.

0 commit comments

Comments
 (0)