1
- IPFS unixFS Engine
2
- ===================
3
-
4
- > Import & Export data to/from an IPFS [ DAG Service] [ ]
1
+ # IPFS unixFS Engine
5
2
6
3
[ ![ ] ( https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square )] ( http://ipn.io )
4
+ [ ![ ] ( https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square )] ( http://ipfs.io/ )
7
5
[ ![ ] ( https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square )] ( http://webchat.freenode.net/?channels=%23ipfs )
6
+ [ ![ standard-readme compliant] ( https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square )] ( https://github.com/RichardLitt/standard-readme )
8
7
[ ![ Build Status] ( https://travis-ci.org/ipfs/js-ipfs-unixfs-engine.svg?style=flat-square )] ( https://travis-ci.org/ipfs/js-ipfs-unixfs-engine )
9
8
[ ![ Coverage Status] ( https://coveralls.io/repos/github/ipfs/js-ipfs-unixfs-engine/badge.svg?branch=master )] ( https://coveralls.io/github/ipfs/js-ipfs-unixfs-engine?branch=master )
10
9
[ ![ Dependency Status] ( https://david-dm.org/ipfs/js-ipfs-unixfs-engine.svg?style=flat-square )] ( https://david-dm.org/ipfs/js-ipfs-unixfs-engine )
11
10
[ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square )] ( https://github.com/feross/standard )
12
11
13
- ## Example Importer
12
+ > JavaScript implementation of the layout and chunking mechanisms used by IPFS
13
+
14
+ ## Table of Contents
15
+
16
+ - [ Install] ( #install )
17
+ - [ Usage] ( #usage )
18
+ - [ Example Importer] ( #example-importer )
19
+ - [ Importer API] ( #importer-api )
20
+ - [ const add = new Importer(dag)] ( #const-add--new-importerdag )
21
+ - [ Example Exporter] ( #example-exporter )
22
+ - [ Exporter: API] ( #exporter-api )
23
+ - [ new Exporter(hash, dagService)] ( #new-exporterhash-dagservice )
24
+ - [ Contribute] ( #contribute )
25
+ - [ License] ( #license )
26
+
27
+ ## Install
28
+
29
+ With [ npm] ( https://npmjs.org/ ) installed, run
30
+
31
+ ```
32
+ $ npm install ipfs-unixfs-engine
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ### Example Importer
14
38
15
39
Let's create a little directory to import:
16
40
``` sh
@@ -91,13 +115,13 @@ When run, the stat of DAG Node is outputted for each file on data event until th
91
115
92
116
```
93
117
94
- ## Importer API
118
+ ### Importer API
95
119
96
120
``` js
97
121
const Importer = require (' ipfs-unixfs-engine' ).importer
98
122
```
99
123
100
- ### const add = new Importer(dag)
124
+ #### const add = new Importer(dag)
101
125
102
126
The importer is a object Transform stream that accepts objects of the form
103
127
@@ -116,7 +140,7 @@ The input's file paths and directory structure will be preserved in the DAG
116
140
Nodes.
117
141
118
142
119
- ## Example Exporter
143
+ ### Example Exporter
120
144
121
145
```
122
146
const ipfsRepo = require('ipfs-repo')
@@ -139,7 +163,7 @@ exportEvent.on('data', (result) => {
139
163
}
140
164
```
141
165
142
- ## Exporter: API
166
+ ### Exporter: API
143
167
``` js
144
168
const Exporter = require (' ipfs-unixfs-engine' ).exporter
145
169
```
@@ -163,19 +187,17 @@ Errors are received as with a normal stream, by listening on the `'error'` event
163
187
to be emitted.
164
188
165
189
166
- ## Install
167
-
168
- With [ npm] ( https://npmjs.org/ ) installed, run
190
+ [ DAG Service ] : https://github.com/vijayee/js-ipfs-merkle-dag/
191
+ [ UnixFS ] : https://github.com/ipfs/specs/tree/master/unixfs
169
192
170
- ```
171
- $ npm install ipfs-unixfs-engine
172
- ```
193
+ ## Contribute
173
194
174
- ## License
195
+ Feel free to join in. All welcome. Open an [ issue ] ( https://github.com/ipfs/js-ipfs-unixfs-engine/issues ) !
175
196
176
- ISC
197
+ This repository falls under the IPFS [ Code of Conduct ] ( https://github.com/ipfs/community/blob/master/code-of-conduct.md ) .
177
198
199
+ [ ![ ] ( https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif )] ( https://github.com/ipfs/community/blob/master/contributing.md )
178
200
179
- [ DAG Service ] : https://github.com/vijayee/js-ipfs-merkle-dag/
180
- [ UnixFS ] : https://github.com/ipfs/specs/tree/master/unixfs
201
+ ## License
181
202
203
+ [ MIT] ( LICENSE )
0 commit comments