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

Document Exporter API a bit more clearly. #46

Merged
merged 1 commit into from
Jun 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
IPFS unixFS Engine
===================

> Import & Export data to/from an [IPFS DAG Service][]
> Import & Export data to/from an IPFS [DAG Service][]

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
Expand Down Expand Up @@ -108,9 +108,9 @@ The importer is a object Transform stream that accepts objects of the form
}
```

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

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

The exporter is a readable stream in object mode that outputs objects of the
### new Exporter(hash, dagService)

Uses the given [DAG Service][] to fetch an IPFS [UnixFS][] object(s) by their
multiaddress.

Creates a new readable stream in object mode that outputs objects of the
form

```js
Expand All @@ -154,7 +159,8 @@ form
}
```

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


## Install
Expand All @@ -170,4 +176,6 @@ $ npm install ipfs-unixfs-engine
ISC


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