diff --git a/README.md b/README.md index e013cd6a..596ac1eb 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,40 @@ -IPFS unixFS Engine -=================== - -> Import & Export data to/from an IPFS [DAG Service][] +# IPFS unixFS Engine [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) +[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) +[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) [![Build Status](https://travis-ci.org/ipfs/js-ipfs-unixfs-engine.svg?style=flat-square)](https://travis-ci.org/ipfs/js-ipfs-unixfs-engine) [![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) [![Dependency Status](https://david-dm.org/ipfs/js-ipfs-unixfs-engine.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-unixfs-engine) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) -## Example Importer +> JavaScript implementation of the layout and chunking mechanisms used by IPFS + +## Table of Contents + +- [Install](#install) +- [Usage](#usage) + - [Example Importer](#example-importer) + - [Importer API](#importer-api) + - [const add = new Importer(dag)](#const-add--new-importerdag) + - [Example Exporter](#example-exporter) + - [Exporter: API](#exporter-api) + - [new Exporter(hash, dagService)](#new-exporterhash-dagservice) +- [Contribute](#contribute) +- [License](#license) + +## Install + +With [npm](https://npmjs.org/) installed, run + +``` +$ npm install ipfs-unixfs-engine +``` + +## Usage + +### Example Importer Let's create a little directory to import: ```sh @@ -91,13 +115,13 @@ When run, the stat of DAG Node is outputted for each file on data event until th ``` -## Importer API +### Importer API ```js const Importer = require('ipfs-unixfs-engine').importer ``` -### const add = new Importer(dag) +#### const add = new Importer(dag) The importer is a object Transform stream that accepts objects of the form @@ -116,7 +140,7 @@ The input's file paths and directory structure will be preserved in the DAG Nodes. -## Example Exporter +### Example Exporter ``` const ipfsRepo = require('ipfs-repo') @@ -139,7 +163,7 @@ exportEvent.on('data', (result) => { } ``` -## Exporter: API +### Exporter: API ```js const Exporter = require('ipfs-unixfs-engine').exporter ``` @@ -163,19 +187,17 @@ Errors are received as with a normal stream, by listening on the `'error'` event to be emitted. -## Install - -With [npm](https://npmjs.org/) installed, run +[DAG Service]: https://github.com/vijayee/js-ipfs-merkle-dag/ +[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs -``` -$ npm install ipfs-unixfs-engine -``` +## Contribute -## License +Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-engine/issues)! -ISC +This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). +[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md) -[DAG Service]: https://github.com/vijayee/js-ipfs-merkle-dag/ -[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs +## License +[MIT](LICENSE)