diff --git a/README.md b/README.md index 1b5f8a5..2219821 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ IPFS Blocks JavaScript Implementation [![](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) -![](https://img.shields.io/badge/coverage-?%25-yellow.svg?style=flat-square) +[![Travis CI](https://travis-ci.org/ipfs/js-ipfs-blocks.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs-blocks) +[![Circle CI](https://circleci.com/gh/ipfs/js-ipfs-blocks.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfs-blocks) +![](https://img.shields.io/badge/coverage-77-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/ipfs/js-ipfs-blocks.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-blocks) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) @@ -28,15 +30,42 @@ IPFS Blocks JavaScript Implementation A Block is a data structure available on this module. -## Usage +# Installation -```bash -$ npm i ipfs-blocks +## npm + +```sh +> npm i ipfs-blocks ``` -```javascript -const ipfsBlocks = require('ipfs-blocks') +## Use in Node.js + +```JavaScript +var ipfsBlocks = require('ipfs-blocks') +``` +## Use in a browser with browserify, webpack or any other bundler + +The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process. + +```JavaScript +var ipfsBlocks = require('ipfs-blocks') +``` + +## Use in a browser Using a script tag + +Loading this module through a script tag will make the `Unixfs` obj available in the global namespace. + +```html + + + +``` + +# Usage + + +```javascript // then, to access each of the components ipfsBlocks.BlockService ipfsBlocks.Block diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..6d74323 --- /dev/null +++ b/circle.yml @@ -0,0 +1,3 @@ +machine: + node: + version: stable