Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit 100e49d

Browse files
committed
chore: update readme
1 parent 741496f commit 100e49d

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ const {
4949
importer
5050
} = require('ipfs-unixfs-engine')
5151
const pull = require('pull-stream')
52+
const fs = require('fs')
5253

53-
// Import path /tmp/foo/bar
54+
// Import path /tmp/bar.txt
5455
pull(
5556
pull.values([{
56-
path: '/tmp/foo/bar',
57-
content: fs.createReadStream(file)
57+
path: '/tmp/bar.txt',
58+
content: fs.createReadStream('/tmp/bar.txt')
5859
}]),
5960

6061
// You need to create and pass an ipld resolver instance
@@ -64,6 +65,19 @@ pull(
6465
// Handle the error and do something with the results
6566
pull.collect((err, files) => {
6667
console.info(files)
68+
69+
// Prints:
70+
// [{
71+
// size: 12,
72+
// leafSize: 4,
73+
// multihash: <Buffer>
74+
// path: '/tmp/bar.txt',
75+
// name: ''
76+
// }, {
77+
// path: 'tmp',
78+
// multihash: <Buffer>
79+
// size: 65
80+
// }]
6781
})
6882
)
6983
```

0 commit comments

Comments
 (0)