ipfs-demo 1.0.6 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +20 -4
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
|
2
|
-
#
|
2
|
+
# IPFS implementations
|
3
3
|
```javascript
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
import {create} from 'ipfs-https-client'
|
5
|
+
const ipfsClient = async () =>{
|
6
|
+
const options ={
|
7
|
+
host:'ipfs.infura.io',
|
8
|
+
port:5001,
|
9
|
+
protocol:'https',
|
10
|
+
|
11
|
+
}
|
12
|
+
const ipfs = await create(options);
|
13
|
+
return ipfs;
|
14
|
+
|
15
|
+
}
|
16
|
+
|
17
|
+
const runFun = async () =>{
|
18
|
+
const addText = await ipfsClient();
|
19
|
+
const storeResult = await addText.add('npm package manager')
|
20
|
+
console.log(storeResult)
|
21
|
+
}
|
22
|
+
```
|