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

Commit 4e11dfc

Browse files
committed
Merge pull request #46 from noffle/readme-exporter
Document Exporter API a bit more clearly.
2 parents bed1482 + 937cbab commit 4e11dfc

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
IPFS unixFS Engine
22
===================
33

4-
> Import & Export data to/from an [IPFS DAG Service][]
4+
> Import & Export data to/from an IPFS [DAG Service][]
55
66
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
77
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
@@ -108,9 +108,9 @@ The importer is a object Transform stream that accepts objects of the form
108108
}
109109
```
110110

111-
The stream will output IPFS DAG Node stats for the nodes it as added to the DAG
112-
Service. When stats on a node are emitted they are guaranteed to have been
113-
written into the DAG Service's storage mechanism.
111+
The stream will output IPFS DAG Node stats for the nodes as they are added to
112+
the DAG Service. When stats on a node are emitted they are guaranteed to have
113+
been written into the [DAG Service][]'s storage mechanism.
114114

115115
The input's file paths and directory structure will be preserved in the DAG
116116
Nodes.
@@ -144,7 +144,12 @@ exportEvent.on('data', (result) => {
144144
const Exporter = require('ipfs-unixfs-engine').exporter
145145
```
146146

147-
The exporter is a readable stream in object mode that outputs objects of the
147+
### new Exporter(hash, dagService)
148+
149+
Uses the given [DAG Service][] to fetch an IPFS [UnixFS][] object(s) by their
150+
multiaddress.
151+
152+
Creates a new readable stream in object mode that outputs objects of the
148153
form
149154

150155
```js
@@ -154,7 +159,8 @@ form
154159
}
155160
```
156161

157-
by the multihash of the file from the DAG Service.
162+
Errors are received as with a normal stream, by listening on the `'error'` event
163+
to be emitted.
158164

159165

160166
## Install
@@ -170,4 +176,6 @@ $ npm install ipfs-unixfs-engine
170176
ISC
171177

172178

173-
[IPFS DAG Service]: https://github.com/vijayee/js-ipfs-merkle-dag/
179+
[DAG Service]: https://github.com/vijayee/js-ipfs-merkle-dag/
180+
[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs
181+

0 commit comments

Comments
 (0)