Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit ee4d69b

Browse files
committed
Merge pull request #6 from ipfs/update/readme+circle
Update the Readme + add Circle
2 parents 3099d06 + c5baa6b commit ee4d69b

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

README.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ IPFS Blocks JavaScript Implementation
44
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
55
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
66
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
7-
![](https://img.shields.io/badge/coverage-?%25-yellow.svg?style=flat-square)
7+
[![Travis CI](https://travis-ci.org/ipfs/js-ipfs-blocks.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs-blocks)
8+
[![Circle CI](https://circleci.com/gh/ipfs/js-ipfs-blocks.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfs-blocks)
9+
![](https://img.shields.io/badge/coverage-77-yellow.svg?style=flat-square)
810
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs-blocks.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-blocks)
911
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
1012

@@ -28,15 +30,42 @@ IPFS Blocks JavaScript Implementation
2830

2931
A Block is a data structure available on this module.
3032

31-
## Usage
33+
# Installation
3234

33-
```bash
34-
$ npm i ipfs-blocks
35+
## npm
36+
37+
```sh
38+
> npm i ipfs-blocks
3539
```
3640

37-
```javascript
38-
const ipfsBlocks = require('ipfs-blocks')
41+
## Use in Node.js
42+
43+
```JavaScript
44+
var ipfsBlocks = require('ipfs-blocks')
45+
```
3946

47+
## Use in a browser with browserify, webpack or any other bundler
48+
49+
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.
50+
51+
```JavaScript
52+
var ipfsBlocks = require('ipfs-blocks')
53+
```
54+
55+
## Use in a browser Using a script tag
56+
57+
Loading this module through a script tag will make the `Unixfs` obj available in the global namespace.
58+
59+
```html
60+
<script src="https://npmcdn.com/ipfs-blocks/dist/index.min.js"></script>
61+
<!-- OR -->
62+
<script src="https://npmcdn.com/ipfs-blocks/dist/index.js"></script>
63+
```
64+
65+
# Usage
66+
67+
68+
```javascript
4069
// then, to access each of the components
4170
ipfsBlocks.BlockService
4271
ipfsBlocks.Block

circle.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
machine:
2+
node:
3+
version: stable

0 commit comments

Comments
 (0)