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 Feb 5, 2023. It is now read-only.
Allows you to define your own version of js-ipfs instead of the predefined fallback. Before it would load js-ipfs v0.38, now it loads the latest version from unpkg by default, which you can override as follows using this configuration property:
Copy file name to clipboardExpand all lines: README.md
+25-9Lines changed: 25 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,22 @@ A one-stop shop for loading an ipfs instance into a webpage.
15
15
Attempts to load ipfs in the following order and returns the result in a Promise:
16
16
1.`window.ipfs.enable`: the current `window.ipfs` api. Available if the user is using Opera or has the ipfs-companion extension installed.
17
17
2.`window.ipfs`: the old `window.ipfs` api. Does not include enabling permissions all at once.
18
-
3.`js-ipfs`: an in-browser ipfs node that communicates via WebRTC/Websockets. The `js-ipfs` code is only loaded if required.
18
+
3.`js-ipfs`: an in-browser ipfs node that communicates via WebRTC/Websockets. The `js-ipfs` code is only loaded if required. Can be configured using the `jsIpfs` setting.
19
+
19
20
20
21
21
22
## Usage
22
-
```
23
+
24
+
```js
23
25
importgetIpfsfrom'get-ipfs'
24
26
25
-
const ipfs = await getIpfs([config])
27
+
constipfs=awaitgetIpfs(config)
26
28
```
27
29
28
-
### Config
29
-
```
30
+
31
+
### Config
32
+
33
+
```js
30
34
{
31
35
// `permissions` are enabled if the browser is ipfs-capable (Opera or extension)
0 commit comments