├── .github
├── ISSUE_TEMPLATE
│ ├── config.yml
│ └── open_an_issue.md
└── config.yml
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── ci
└── Jenkinsfile
├── package.json
├── src
└── index.js
└── test
├── browser.js
├── node.js
└── unixfs-engine.spec.js
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Getting Help on IPFS
4 | url: https://ipfs.io/help
5 | about: All information about how and where to get help on IPFS.
6 | - name: IPFS Official Forum
7 | url: https://discuss.ipfs.io
8 | about: Please post general questions, support requests, and discussions here.
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/open_an_issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Open an issue
3 | about: Only for actionable issues relevant to this repository.
4 | title: ''
5 | labels: need/triage
6 | assignees: ''
7 |
8 | ---
9 |
20 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | # Configuration for welcome - https://github.com/behaviorbot/welcome
2 |
3 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4 | # Comment to be posted to on first time issues
5 | newIssueWelcomeComment: >
6 | Thank you for submitting your first issue to this repository! A maintainer
7 | will be here shortly to triage and review.
8 |
9 | In the meantime, please double-check that you have provided all the
10 | necessary information to make this process easy! Any information that can
11 | help save additional round trips is useful! We currently aim to give
12 | initial feedback within **two business days**. If this does not happen, feel
13 | free to leave a comment.
14 |
15 | Please keep an eye on how this issue will be labeled, as labels give an
16 | overview of priorities, assignments and additional actions requested by the
17 | maintainers:
18 |
19 | - "Priority" labels will show how urgent this is for the team.
20 | - "Status" labels will show if this is ready to be worked on, blocked, or in progress.
21 | - "Need" labels will indicate if additional input or analysis is required.
22 |
23 | Finally, remember to use https://discuss.ipfs.io if you just need general
24 | support.
25 |
26 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
27 | # Comment to be posted to on PRs from first time contributors in your repository
28 | newPRWelcomeComment: >
29 | Thank you for submitting this PR!
30 |
31 | A maintainer will be here shortly to review it.
32 |
33 | We are super grateful, but we are also overloaded! Help us by making sure
34 | that:
35 |
36 | * The context for this PR is clear, with relevant discussion, decisions
37 | and stakeholders linked/mentioned.
38 |
39 | * Your contribution itself is clear (code comments, self-review for the
40 | rest) and in its best form. Follow the [code contribution
41 | guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#code-contribution-guidelines)
42 | if they apply.
43 |
44 | Getting other community members to do a review would be great help too on
45 | complex PRs (you can ask in the chats/forums). If you are unsure about
46 | something, just leave us a comment.
47 |
48 | Next steps:
49 |
50 | * A maintainer will triage and assign priority to this PR, commenting on
51 | any missing things and potentially assigning a reviewer for high
52 | priority items.
53 |
54 | * The PR gets reviews, discussed and approvals as needed.
55 |
56 | * The PR is merged by maintainers when it has been approved and comments addressed.
57 |
58 | We currently aim to provide initial feedback/triaging within **two business
59 | days**. Please keep an eye on any labelling actions, as these will indicate
60 | priorities and status of your contribution.
61 |
62 | We are very grateful for your contribution!
63 |
64 |
65 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
66 | # Comment to be posted to on pull requests merged by a first time user
67 | # Currently disabled
68 | #firstPRMergeComment: ""
69 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | docs
2 | yarn.lock
3 | **/node_modules/
4 | **/*.log
5 | test/repo-tests*
6 | **/bundle.js
7 |
8 | # Logs
9 | logs
10 | *.log
11 |
12 | coverage
13 |
14 | # Runtime data
15 | pids
16 | *.pid
17 | *.seed
18 |
19 | # Directory for instrumented libs generated by jscoverage/JSCover
20 | lib-cov
21 |
22 | # Coverage directory used by tools like istanbul
23 | coverage
24 | .nyc_output
25 |
26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27 | .grunt
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | build
33 |
34 | # Dependency directory
35 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
36 | node_modules
37 |
38 | lib
39 | dist
40 | test/test-data/go-ipfs-repo/LOCK
41 | test/test-data/go-ipfs-repo/LOG
42 | test/test-data/go-ipfs-repo/LOG.old
43 |
44 | # while testing npm5
45 | package-lock.json
46 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 |
2 | .DS_Store
3 | tests/repo-tests*
4 |
5 | # Logs
6 | logs
7 | *.log
8 |
9 | # Runtime data
10 | pids
11 | *.pid
12 | *.seed
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21 | .grunt
22 |
23 | # node-waf configuration
24 | .lock-wscript
25 |
26 | # Compiled binary addons (http://nodejs.org/api/addons.html)
27 | build/Release
28 |
29 | # Dependency directory
30 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
31 | node_modules
32 |
33 | test
34 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | cache: npm
3 | stages:
4 | - check
5 | - test
6 | - cov
7 |
8 | node_js:
9 | - '10'
10 |
11 | os:
12 | - linux
13 | - osx
14 | - windows
15 |
16 | script: npx nyc -s npm run test:node -- --bail
17 | after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
18 |
19 | jobs:
20 | include:
21 | - stage: check
22 | script:
23 | - npx aegir commitlint --travis
24 | - npx aegir dep-check
25 | - npm run lint
26 |
27 | - stage: test
28 | name: chrome
29 | addons:
30 | chrome: stable
31 | script: npx aegir test -t browser -t webworker
32 |
33 | - stage: test
34 | name: firefox
35 | addons:
36 | firefox: latest
37 | script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
38 |
39 | notifications:
40 | email: false
41 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 | ## [0.35.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.35.3...v0.35.4) (2019-01-04)
3 |
4 |
5 |
6 |
7 | ## [0.35.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.35.2...v0.35.3) (2018-12-03)
8 |
9 |
10 |
11 |
12 | ## [0.35.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.35.1...v0.35.2) (2018-11-29)
13 |
14 |
15 |
16 |
17 | ## [0.35.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.35.0...v0.35.1) (2018-11-26)
18 |
19 |
20 |
21 |
22 | # [0.35.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.34.0...v0.35.0) (2018-11-25)
23 |
24 |
25 |
26 |
27 | # [0.34.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.33.0...v0.34.0) (2018-11-12)
28 |
29 |
30 | ### Bug Fixes
31 |
32 | * updates ipld-dag-pb dep to version without .cid properties ([aa61cce](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/aa61cce))
33 |
34 |
35 |
36 |
37 | # [0.33.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.8...v0.33.0) (2018-10-27)
38 |
39 |
40 | ### Bug Fixes
41 |
42 | * fixes [#230](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/230) by returning a through stream that emits the error instead of throwing it ([fdd8429](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/fdd8429))
43 |
44 |
45 |
46 |
47 | ## [0.32.8](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.7...v0.32.8) (2018-10-25)
48 |
49 |
50 |
51 |
52 | ## [0.32.7](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.6...v0.32.7) (2018-10-12)
53 |
54 |
55 | ### Bug Fixes
56 |
57 | * return correct chunks of streams, fixes [#229](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/229) ([362c685](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/362c685))
58 | * skip rabin tests on windows ([ea9e3c3](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/ea9e3c3))
59 |
60 |
61 |
62 |
63 | ## [0.32.6](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.5...v0.32.6) (2018-10-12)
64 |
65 |
66 | ### Bug Fixes
67 |
68 | * do not use cid property of DAGNodes just yet ([7a2a308](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/7a2a308))
69 |
70 |
71 |
72 |
73 | ## [0.32.5](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.4...v0.32.5) (2018-10-12)
74 |
75 |
76 | ### Bug Fixes
77 |
78 | * do not overwrite cid property of DAGNodes ([c2e38ae](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/c2e38ae))
79 | * make sure errors from unmarshalling are caught ([8b2335c](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/8b2335c))
80 |
81 |
82 |
83 |
84 | ## [0.32.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.3...v0.32.4) (2018-08-23)
85 |
86 |
87 | ### Bug Fixes
88 |
89 | * build & export interop with go-ipfs for small file raw leaves ([11885fa](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/11885fa))
90 |
91 |
92 |
93 |
94 | ## [0.32.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.2...v0.32.3) (2018-08-21)
95 |
96 |
97 | ### Bug Fixes
98 |
99 | * import with CID version 1 ([6ef929d](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/6ef929d))
100 | * typo ([c5cb38b](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/c5cb38b))
101 |
102 |
103 |
104 |
105 | ## [0.32.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.1...v0.32.2) (2018-08-11)
106 |
107 |
108 | ### Bug Fixes
109 |
110 | * make rabin an optional dependency ([bef3152](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/bef3152))
111 | * skip first hash algorithm as it is no longer valid ([0b84b76](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/0b84b76)), closes [js-multihash#57](https://github.com/js-multihash/issues/57)
112 |
113 |
114 |
115 |
116 | ## [0.32.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.32.0...v0.32.1) (2018-08-08)
117 |
118 |
119 | ### Bug Fixes
120 |
121 | * do not emit empty buffers for non-empty files ([ccc4ad2](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/ccc4ad2))
122 |
123 |
124 |
125 |
126 | # [0.32.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.31.3...v0.32.0) (2018-08-08)
127 |
128 |
129 | ### Features
130 |
131 | * **importer:** add rabin fingerprinting chunk algorithm ([83a5feb](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/83a5feb)), closes [ipfs/js-ipfs#1283](https://github.com/ipfs/js-ipfs/issues/1283)
132 |
133 |
134 |
135 |
136 | ## [0.31.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.31.2...v0.31.3) (2018-07-24)
137 |
138 |
139 | ### Bug Fixes
140 |
141 | * return cids from builder ([0d3d3d8](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/0d3d3d8))
142 |
143 |
144 |
145 |
146 | ## [0.31.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.31.1...v0.31.2) (2018-07-20)
147 |
148 |
149 |
150 |
151 | ## [0.31.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.31.0...v0.31.1) (2018-07-19)
152 |
153 |
154 |
155 |
156 | # [0.31.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.30.1...v0.31.0) (2018-07-19)
157 |
158 |
159 |
160 |
161 | ## [0.30.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.30.0...v0.30.1) (2018-07-19)
162 |
163 |
164 | ### Features
165 |
166 | * support --raw-leaves ([7a29d83](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/7a29d83)), closes [ipfs/js-ipfs#1432](https://github.com/ipfs/js-ipfs/issues/1432)
167 |
168 |
169 |
170 |
171 | # [0.30.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.29.0...v0.30.0) (2018-06-12)
172 |
173 |
174 |
175 |
176 | # [0.29.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.28.1...v0.29.0) (2018-04-23)
177 |
178 |
179 |
180 |
181 | ## [0.28.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.28.0...v0.28.1) (2018-04-12)
182 |
183 |
184 |
185 |
186 | # [0.28.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.27.0...v0.28.0) (2018-04-10)
187 |
188 |
189 |
190 |
191 | # [0.27.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.26.0...v0.27.0) (2018-03-27)
192 |
193 |
194 | ### Features
195 |
196 | * exporter - support slicing streams stored in deeply nested DAGs ([#208](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/208)) ([8568cd5](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/8568cd5))
197 |
198 |
199 |
200 |
201 | # [0.26.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.25.0...v0.26.0) (2018-03-22)
202 |
203 |
204 | ### Features
205 |
206 | * Adds begin/end byte slices to exporter ([#207](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/207)) ([8e11d77](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/8e11d77))
207 |
208 |
209 |
210 |
211 | # [0.25.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.24.4...v0.25.0) (2018-03-20)
212 |
213 |
214 | ### Features
215 |
216 | * Add reader to read files or part of files as streams ([833accf](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/833accf))
217 |
218 |
219 |
220 |
221 | ## [0.24.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.24.3...v0.24.4) (2018-02-27)
222 |
223 |
224 | ### Bug Fixes
225 |
226 | * use "ipld" instead of "ipld-resolver" ([f4de206](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/f4de206))
227 |
228 |
229 |
230 |
231 | ## [0.24.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.24.2...v0.24.3) (2018-02-27)
232 |
233 |
234 |
235 |
236 | ## [0.24.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.24.1...v0.24.2) (2017-12-15)
237 |
238 |
239 |
240 |
241 | ## [0.24.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.24.0...v0.24.1) (2017-11-12)
242 |
243 |
244 |
245 |
246 | # [0.24.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.23.1...v0.24.0) (2017-11-12)
247 |
248 |
249 | ### Features
250 |
251 | * exporter maxDepth ([#197](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/197)) ([211e4e3](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/211e4e3))
252 |
253 |
254 |
255 |
256 | ## [0.23.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.23.0...v0.23.1) (2017-11-10)
257 |
258 |
259 | ### Features
260 |
261 | * windows interop ([#195](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/195)) ([aa21ff3](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/aa21ff3))
262 |
263 |
264 |
265 |
266 | # [0.23.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.22.5...v0.23.0) (2017-11-07)
267 |
268 |
269 | ### Features
270 |
271 | * Include hash field for exported files ([#191](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/191)) ([8b13957](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/8b13957))
272 |
273 |
274 |
275 |
276 | ## [0.22.5](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.22.4...v0.22.5) (2017-09-08)
277 |
278 |
279 | ### Features
280 |
281 | * Use passed cidVersion option when writing to storage ([#185](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/185)) ([0cd2d60](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/0cd2d60))
282 |
283 |
284 |
285 |
286 | ## [0.22.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.22.3...v0.22.4) (2017-09-08)
287 |
288 |
289 | ### Features
290 |
291 | * allow specify hash algorithm for large files ([#184](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/184)) ([69915da](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/69915da))
292 |
293 |
294 |
295 |
296 | ## [0.22.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.22.2...v0.22.3) (2017-09-07)
297 |
298 |
299 |
300 |
301 | ## [0.22.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.22.1...v0.22.2) (2017-09-07)
302 |
303 |
304 | ### Features
305 |
306 | * Add `onlyHash` option ([#183](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/183)) ([7450a65](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/7450a65))
307 | * adds call to progress bar function ([#179](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/179)) ([ac6f722](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/ac6f722))
308 |
309 |
310 |
311 |
312 | ## [0.22.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.22.0...v0.22.1) (2017-09-04)
313 |
314 |
315 |
316 |
317 | # [0.22.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.21.0...v0.22.0) (2017-07-23)
318 |
319 |
320 |
321 |
322 | # [0.21.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.20.0...v0.21.0) (2017-07-04)
323 |
324 |
325 |
326 |
327 | # [0.20.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.19.2...v0.20.0) (2017-06-16)
328 |
329 |
330 | ### Features
331 |
332 | * subtree support ([#175](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/175)) ([16b788c](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/16b788c))
333 |
334 |
335 |
336 |
337 | ## [0.19.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.19.1...v0.19.2) (2017-05-25)
338 |
339 |
340 | ### Bug Fixes
341 |
342 | * **package:** update cids to version 0.5.0 ([59d6d0a](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/59d6d0a))
343 |
344 |
345 | ### Features
346 |
347 | * dag-api direct support ([adaeb37](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/adaeb37))
348 |
349 |
350 |
351 |
352 | ## [0.19.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.19.0...v0.19.1) (2017-03-29)
353 |
354 |
355 | ### Bug Fixes
356 |
357 | * adding a dir: leaf node gets replaced with dir if necessary ([1d682ec](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/1d682ec))
358 |
359 |
360 |
361 |
362 | # [0.19.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.18.0...v0.19.0) (2017-03-24)
363 |
364 |
365 | ### Bug Fixes
366 |
367 | * breaking the stack when importing ([993f746](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/993f746))
368 | * passing browser tests ([29b2740](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/29b2740))
369 | * using correct murmur3 codec name ([295d86e](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/295d86e))
370 | * using the new IPLD API ([a80f4d8](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/a80f4d8))
371 |
372 |
373 |
374 |
375 | # [0.18.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.17.0...v0.18.0) (2017-03-22)
376 |
377 |
378 | ### Bug Fixes
379 |
380 | * **package:** update ipld-dag-pb to version 0.10.0 ([#154](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/154)) ([304ff25](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/304ff25))
381 | * **package:** update pull-pause to version 0.0.1 ([#153](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/153)) ([4dd2143](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/4dd2143))
382 |
383 |
384 | ### Features
385 |
386 | * upgrade to the next version of ipfs-block and blockservice ([0ca25b2](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/0ca25b2))
387 |
388 |
389 |
390 |
391 | # [0.17.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.16.1...v0.17.0) (2017-02-08)
392 |
393 |
394 | ### Features
395 |
396 | * update to latest ipld-resolver ([#137](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/137)) ([211dfb6](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/211dfb6))
397 |
398 |
399 |
400 |
401 | ## [0.16.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.16.0...v0.16.1) (2017-02-02)
402 |
403 |
404 | ### Bug Fixes
405 |
406 | * exporter: recurse correctly into subdirs ([#136](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/136)) ([69c0d04](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/69c0d04))
407 |
408 |
409 |
410 |
411 | # [0.16.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.15.4...v0.16.0) (2017-02-02)
412 |
413 |
414 | ### Bug Fixes
415 |
416 | * **package:** update is-ipfs to version 0.3.0 ([#134](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/134)) ([0063f9d](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/0063f9d))
417 |
418 |
419 |
420 |
421 | ## [0.15.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.15.3...v0.15.4) (2017-01-31)
422 |
423 |
424 | ### Bug Fixes
425 |
426 | * case for empty file ([#132](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/132)) ([fee55d1](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/fee55d1))
427 |
428 |
429 |
430 |
431 | ## [0.15.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.15.2...v0.15.3) (2017-01-30)
432 |
433 |
434 | ### Bug Fixes
435 |
436 | * expect empty stream to not generate any nodes ([#131](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/131)) ([7b054b6](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/7b054b6))
437 |
438 |
439 |
440 |
441 | ## [0.15.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.15.1...v0.15.2) (2017-01-30)
442 |
443 |
444 | ### Bug Fixes
445 |
446 | * stop export visitor from trying to resolve leaf object ([#130](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/130)) ([651f113](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/651f113))
447 |
448 |
449 |
450 |
451 | ## [0.15.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.15.0...v0.15.1) (2017-01-29)
452 |
453 |
454 | ### Bug Fixes
455 |
456 | * **package:** update cids to version 0.4.0 ([#122](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/122)) ([65a6759](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/65a6759))
457 |
458 |
459 |
460 |
461 | # [0.15.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.14.2...v0.15.0) (2017-01-11)
462 |
463 |
464 |
465 |
466 | ## [0.14.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.14.1...v0.14.2) (2016-12-13)
467 |
468 |
469 |
470 |
471 | ## [0.14.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.14.0...v0.14.1) (2016-12-08)
472 |
473 |
474 |
475 |
476 | # [0.14.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.13.0...v0.14.0) (2016-11-24)
477 |
478 |
479 | ### Features
480 |
481 | * upgrade to latest dag-pb API ([#88](https://github.com/ipfs/js-ipfs-unixfs-engine/issues/88)) ([51d1245](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/51d1245))
482 |
483 |
484 |
485 |
486 | # [0.13.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.12.0...v0.13.0) (2016-11-03)
487 |
488 |
489 |
490 |
491 | # [0.12.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.11.4...v0.12.0) (2016-10-28)
492 |
493 |
494 | ### Bug Fixes
495 |
496 | * **exporter:** add some parallel fetching of blocks where possible ([43503d4](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/43503d4))
497 |
498 |
499 | ### Features
500 |
501 | * migrate importer to use IPLD Resolver and the new IPLD format ([89c3602](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/89c3602))
502 |
503 |
504 |
505 |
506 | ## [0.11.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.11.3...v0.11.4) (2016-09-11)
507 |
508 |
509 | ### Features
510 |
511 | * **exporter:** implement recursive file export ([68e09a7](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/68e09a7))
512 |
513 |
514 |
515 |
516 | ## [0.11.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.11.2...v0.11.3) (2016-09-09)
517 |
518 |
519 | ### Features
520 |
521 | * **exporter:** return file sizes ([73cf78a](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/73cf78a))
522 |
523 |
524 |
525 |
526 | ## [0.11.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.11.1...v0.11.2) (2016-09-09)
527 |
528 |
529 |
530 |
531 | ## [0.11.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.11.0...v0.11.1) (2016-09-09)
532 |
533 |
534 |
535 |
536 | # [0.11.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.10.2...v0.11.0) (2016-09-08)
537 |
538 |
539 | ### Bug Fixes
540 |
541 | * **tests:** ignore ordering ([f8d1b2a](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/f8d1b2a))
542 |
543 |
544 |
545 |
546 | ## [0.10.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.10.1...v0.10.2) (2016-08-09)
547 |
548 |
549 |
550 |
551 | ## [0.10.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.10.0...v0.10.1) (2016-08-09)
552 |
553 |
554 |
555 |
556 | # [0.10.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.9.0...v0.10.0) (2016-06-28)
557 |
558 |
559 |
560 |
561 | # [0.9.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.8.0...v0.9.0) (2016-05-27)
562 |
563 |
564 |
565 |
566 | # [0.8.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.7.0...v0.8.0) (2016-05-21)
567 |
568 |
569 |
570 |
571 | # [0.7.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.6.1...v0.7.0) (2016-05-21)
572 |
573 |
574 |
575 |
576 | ## [0.6.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.6.0...v0.6.1) (2016-05-05)
577 |
578 |
579 |
580 |
581 | # [0.6.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.5.0...v0.6.0) (2016-05-03)
582 |
583 |
584 |
585 |
586 | # [0.5.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.4.5...v0.5.0) (2016-04-26)
587 |
588 |
589 |
590 |
591 | ## [0.4.5](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.4.4...v0.4.5) (2016-04-24)
592 |
593 |
594 |
595 |
596 | ## [0.4.4](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.4.3...v0.4.4) (2016-04-24)
597 |
598 |
599 |
600 |
601 | ## [0.4.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.4.2...v0.4.3) (2016-04-24)
602 |
603 |
604 | ### Bug Fixes
605 |
606 | * clean up dependencies ([a3bee40](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/a3bee40))
607 | * **importer:** cleanup smaller issues ([eab17fe](https://github.com/ipfs/js-ipfs-unixfs-engine/commit/eab17fe))
608 |
609 |
610 |
611 |
612 | ## [0.4.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.4.1...v0.4.2) (2016-04-19)
613 |
614 |
615 |
616 |
617 | ## [0.4.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.4.0...v0.4.1) (2016-04-19)
618 |
619 |
620 |
621 |
622 | # [0.4.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.3.3...v0.4.0) (2016-04-19)
623 |
624 |
625 |
626 |
627 | ## [0.3.3](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.3.2...v0.3.3) (2016-03-22)
628 |
629 |
630 |
631 |
632 | ## [0.3.2](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.3.1...v0.3.2) (2016-03-22)
633 |
634 |
635 |
636 |
637 | ## [0.3.1](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.3.0...v0.3.1) (2016-03-22)
638 |
639 |
640 |
641 |
642 | # [0.3.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.2.0...v0.3.0) (2016-03-21)
643 |
644 |
645 |
646 |
647 | # [0.2.0](https://github.com/ipfs/js-ipfs-unixfs-engine/compare/v0.1.0...v0.2.0) (2016-02-17)
648 |
649 |
650 |
651 |
652 | # 0.1.0 (2016-02-12)
653 |
654 |
655 |
656 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 David Dias
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [ARCHIVED]
2 |
3 | > This module has been merged into [ipfs/js-ipfs-unixfs](https://github.com/ipfs/js-ipfs-unixfs) where development continues. Please open issues/PRs there.
4 |
5 | # ipfs-unixfs-engine
6 |
7 | [](http://ipn.io)
8 | [](http://ipfs.io/)
9 | [](http://webchat.freenode.net/?channels=%23ipfs)
10 | [](https://github.com/RichardLitt/standard-readme)
11 | [](https://travis-ci.com/ipfs/js-ipfs-unixfs-engine)
12 | [](https://codecov.io/gh/ipfs/js-ipfs-unixfs-engine)
13 | [](https://david-dm.org/ipfs/js-ipfs-unixfs-engine)
14 | [](https://github.com/feross/standard)
15 | 
16 | 
17 |
18 | > JavaScript implementation of the layout and chunking mechanisms used by IPFS to handle Files
19 |
20 | ## Lead Maintainer
21 |
22 | [Alex Potsides](https://github.com/achingbrain)
23 |
24 | ## Table of Contents
25 |
26 | - [Install](#install)
27 | - [Usage](#usage)
28 | - [Importing a file](#importing-a-file)
29 | - [Exporting a file](#exporting-a-file)
30 | - [Contribute](#contribute)
31 | - [License](#license)
32 |
33 | ## Install
34 |
35 | ```
36 | > npm install ipfs-unixfs-engine
37 | ```
38 |
39 | ## Usage
40 |
41 | The `unixfs-engine` exports the [`unixfs-importer`](https://npmjs.com/packages/ipfs-unixfs-importer) and [`unixfs-exporter`](https://npmjs.com/packages/ipfs-unixfs-exporter) modules. Please see those modules for for full documentation.
42 |
43 | ### Importing a file
44 |
45 | The importer is a [pull-stream through](https://github.com/pull-stream/pull-stream#through) which takes objects of the form `{ path, content }` where `path` is a string path and `content` can be a `Buffer`, a `ReadableStream` or a `pull-stream` that emits `Buffer`s.
46 |
47 | It requires an [ipld](https://npmjs.com/packages/ipld) resolver to persist [DAGNodes](https://npmjs.com/packages/ipld-dag-pb) and make them available over IPFS.
48 |
49 | See the [`unixfs-importer`](https://npmjs.com/packages/ipfs-unixfs-importer) module for full documentation.
50 |
51 | ```js
52 | const {
53 | importer
54 | } = require('ipfs-unixfs-engine')
55 | const pull = require('pull-stream')
56 | const fs = require('fs')
57 |
58 | // Import path /tmp/bar.txt
59 | pull(
60 | pull.values([{
61 | path: '/tmp/bar.txt',
62 | content: fs.createReadStream('/tmp/bar.txt')
63 | }]),
64 |
65 | // You need to create and pass an ipld resolver instance
66 | // https://npmjs.com/packages/ipld
67 | importer(, ),
68 |
69 | // Handle the error and do something with the results
70 | pull.collect((err, files) => {
71 | console.info(files)
72 |
73 | // Prints:
74 | // [{
75 | // size: 12,
76 | // leafSize: 4,
77 | // multihash:
78 | // path: '/tmp/bar.txt',
79 | // name: ''
80 | // }, {
81 | // path: 'tmp',
82 | // multihash:
83 | // size: 65
84 | // }]
85 | })
86 | )
87 | ```
88 |
89 | ### Exporting a file
90 |
91 | The exporter is a [pull-stream source](https://github.com/pull-stream/pull-stream#source-readable-stream-that-produces-values) which takes a [cid](https://npmjs.com/packages/cids) and an [ipld](https://npmjs.com/packages/ipld) resolver.
92 |
93 | See the [`unixfs-exporter`](https://npmjs.com/packages/ipfs-unixfs-exporter) module for full documentation.
94 |
95 | ```js
96 | const {
97 | exporter
98 | } = require('ipfs-unixfs-engine').exporter
99 | const pull = require('pull-stream')
100 | const drain = require('pull-stream/sinks/drain')
101 |
102 | pull(
103 | // You need to create and pass an ipld resolver instance
104 | // https://npmjs.com/packages/ipld
105 | exporter(cid, ipld),
106 | drain((file) => {
107 | // file.content is a pull stream containing the bytes of the file
108 | })
109 | )
110 | ```
111 |
112 | ## Contribute
113 |
114 | Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-engine/issues)!
115 |
116 | This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
117 |
118 | [](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
119 |
120 | ## License
121 |
122 | [MIT](LICENSE)
123 |
--------------------------------------------------------------------------------
/ci/Jenkinsfile:
--------------------------------------------------------------------------------
1 | // Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories.
2 | javascript()
3 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ipfs-unixfs-engine",
3 | "version": "0.35.4",
4 | "description": "JavaScript implementation of the unixfs Engine used by IPFS",
5 | "leadMaintainer": "Alex Potsides ",
6 | "main": "src/index.js",
7 | "browser": {
8 | "fs": false,
9 | "rabin": false
10 | },
11 | "scripts": {
12 | "test": "aegir test",
13 | "test:node": "aegir test -t node",
14 | "test:browser": "aegir test -t browser",
15 | "test:webworker": "aegir test -t webworker",
16 | "build": "aegir build",
17 | "lint": "aegir lint",
18 | "release": "aegir release",
19 | "release-minor": "aegir release --type minor",
20 | "release-major": "aegir release --type major",
21 | "coverage": "aegir coverage"
22 | },
23 | "repository": {
24 | "type": "git",
25 | "url": "git+https://github.com/ipfs/js-ipfs-unixfs-engine.git"
26 | },
27 | "keywords": [
28 | "IPFS"
29 | ],
30 | "license": "MIT",
31 | "bugs": {
32 | "url": "https://github.com/ipfs/js-ipfs-unixfs-engine/issues"
33 | },
34 | "engines": {
35 | "node": ">=8.0.0",
36 | "npm": ">=3.0.0"
37 | },
38 | "homepage": "https://github.com/ipfs/js-ipfs-unixfs-engine#readme",
39 | "devDependencies": {
40 | "aegir": "^18.0.2",
41 | "chai": "^4.2.0",
42 | "dirty-chai": "^2.0.1"
43 | },
44 | "dependencies": {
45 | "ipfs-unixfs-exporter": "~0.35.4",
46 | "ipfs-unixfs-importer": "~0.38.0"
47 | },
48 | "contributors": [
49 | "Alan Shaw ",
50 | "Arpit Agarwal ",
51 | "Bernard Mordan ",
52 | "Dan Ordille ",
53 | "David Dias ",
54 | "Diogo Silva ",
55 | "Francisco Baio Dias ",
56 | "Friedel Ziegelmayer ",
57 | "Greenkeeper ",
58 | "Marcin Rataj ",
59 | "Pedro Teixeira ",
60 | "Richard Littauer ",
61 | "Richard Schneider ",
62 | "Stephen Whitmore ",
63 | "Volker Mische ",
64 | "achingbrain ",
65 | "greenkeeper[bot] ",
66 | "jbenet ",
67 | "nginnever ",
68 | "ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "
69 | ]
70 | }
71 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | exports.importer = exports.Importer = require('ipfs-unixfs-importer')
4 | exports.exporter = exports.Exporter = require('ipfs-unixfs-exporter')
5 |
--------------------------------------------------------------------------------
/test/browser.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | require('./node')
4 |
--------------------------------------------------------------------------------
/test/node.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | require('./unixfs-engine.spec')
4 |
--------------------------------------------------------------------------------
/test/unixfs-engine.spec.js:
--------------------------------------------------------------------------------
1 | /* eslint-env mocha */
2 | 'use strict'
3 |
4 | const expect = require('chai').expect
5 | const engine = require('../')
6 |
7 | describe('unixfs-engine', () => {
8 | it('should export the exporter', () => {
9 | expect(engine.exporter).to.be.a('function')
10 | })
11 |
12 | it('should export the exporter as a class', () => {
13 | expect(engine.Exporter).to.be.a('function')
14 | })
15 |
16 | it('should export the importer', () => {
17 | expect(engine.importer).to.be.a('function')
18 | })
19 |
20 | it('should export the importer as a class', () => {
21 | expect(engine.Importer).to.be.a('function')
22 | })
23 | })
24 |
--------------------------------------------------------------------------------