ipfs-unixfs-engine
JavaScript implementation of the layout and chunking mechanisms used by IPFS to handle Files
Lead Maintainer
Table of Contents
Install
> npm install ipfs-unixfs-engine
Usage
The unixfs-engine
exports the unixfs-importer
and unixfs-exporter
modules. Please see those modules for for full documentation.
Importing a file
The importer is a 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.
It requires an ipld resolver to persist DAGNodes and make them available over IPFS.
See the unixfs-importer
module for full documentation.
const importer } = const pull = const fs = // Import path /tmp/bar.txt
Exporting a file
The exporter is a pull-stream source which takes a cid and an ipld resolver.
See the unixfs-exporter
module for full documentation.
const exporter } = exporterconst pull = const drain =
Contribute
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.