peer-info JavaScript implementation
[
](https://travis-ci.org/diasdavid/js-peer-info)
![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)
IPFS Peer abstraction JavaScript implementation
Description
Usage
In Node.js through npm
$ npm install --save peer-info
var PeerInfo = require('peer-info')
In the Browser through browserify
Same as in Node.js, you just have to browserify the code before serving it. See the browserify repo for how to do that.
In the Browser through <script>
tag
Make the peer-info.min.js available through your server and load it using a normal <script>
tag, this will export the peerId
constructor on the window
object, such that:
var PeerInfo = window.PeerInfo
Gotchas
You will need to use Node.js Buffer
API compatible, if you are running inside the browser, you can access it by PeerInfo.Buffer
or you can install Feross's Buffer.