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

Commit d78f82c

Browse files
authored
fix #188
1 parent 2f37c79 commit d78f82c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ And write the importing logic:
5252

5353
```js
5454
const Importer = require('ipfs-unixfs-engine').Importer
55-
const filesAddStream = new Importer(<dag or ipld-resolver instance)
55+
56+
// You need to create and pass an ipld-resolve instance
57+
// https://github.com/ipld/js-ipld-resolver
58+
const filesAddStream = new Importer(<ipld-resolver instance>)
5659

5760
// An array to hold the return of nested file/dir info from the importer
5861
// A root DAG Node is received upon completion
@@ -62,8 +65,8 @@ const res = []
6265
// Import path /tmp/foo/bar
6366
const rs = fs.createReadStream(file)
6467
const rs2 = fs.createReadStream(file2)
65-
const input = { path: /tmp/foo/bar, content: rs }
66-
const input2 = { path: /tmp/foo/quxx, content: rs2 }
68+
const input = { path: '/tmp/foo/bar', content: rs }
69+
const input2 = { path: '/tmp/foo/quxx', content: rs2 }
6770

6871
// Listen for the data event from the importer stream
6972
filesAddStream.on('data', (info) => res.push(info))

0 commit comments

Comments
 (0)