From d7ab4bd8fb0f8afdc6e9fa3354d92f8d975f165b Mon Sep 17 00:00:00 2001 From: David Dias Date: Thu, 5 Nov 2015 17:47:44 +0000 Subject: [PATCH] complement readme --- README.md | 30 +++++++++++++++++++++++++----- src/index.js | 2 ++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 028a0b1..3ad3383 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -peer-id Node.js implementation +peer-id JavaScript implementation ============================== -[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![Build Status](https://travis-ci.org/diasdavid/node-peer-id.svg?style=flat-square)](https://travis-ci.org/diasdavid/node-peer-id) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/diasdavid/node-peer-id.svg?style=flat-square)](https://david-dm.org/diasdavid/node-peer-id) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![Build Status](https://travis-ci.org/diasdavid/js-peer-id.svg?style=flat-square)](https://travis-ci.org/diasdavid/js-peer-id) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/diasdavid/js-peer-id.svg?style=flat-square)](https://david-dm.org/diasdavid/js-peer-id) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) -> IPFS Peer Id implementation in Node.js +> IPFS Peer Id implementation in JavaScript # Description @@ -11,12 +11,32 @@ A IPFS Peer Id is based on a sha256 has of the peer public key, using [multihash # Usage -### Installing +### In Node.js through npm +```bash +$ npm install --save peer-id ``` -$ npm install peer-id + +```javascript +var PeerId = require('peer-id') ``` +### In the Browser through browserify + +Same as in Node.js, you just have to [browserify](https://github.com/substack/node-browserify) the code before serving it. See the browserify repo for how to do that. + +### In the Browser through `