You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 25, 2021. It is now read-only.
feat: add .path and .path.silent functions to detect binary (#40)
After installation if you wish to specify a path to the installed
binary, it's useful for this module to be able to tell the world
where it put the binary, so this PR adds `.path` and `.path.silent()`
functions to do that.
This way we can use the installed module without having to rely on
any external context or platform.
fixes#25
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,22 @@ This module downloads `go-ipfs` binaries from https://dist.ipfs.io into your pro
23
23
24
24
By default it will download the go-ipfs version that matches the npm version of this module. So depending on `[email protected]` will install `go-ipfs v0.4.19` for your current system architecture, in to your project at `node_modules/go-ipfs-dep/go-ipfs/ipfs`.
25
25
26
+
After downloading you can find out the path of the installed binary by calling the `path` function exported by this module:
27
+
28
+
```javascript
29
+
const { path } =require('go-ipfs-dep')
30
+
31
+
console.info('go-ipfs is installed at', path())
32
+
```
33
+
34
+
An error will be thrown if the path to the binary cannot be resolved - if you do not wish this to happen, call `path.silent()`:
35
+
36
+
```javascript
37
+
const { path:silent } =require('go-ipfs-dep')
38
+
39
+
console.info('go-ipfs may installed at', silent())
40
+
```
41
+
26
42
### Overriding the go-ipfs version
27
43
28
44
You can override the version of go-ipfs that gets downloaded by adding by adding a `go-ipfs.version` field to your `package.json`
0 commit comments