mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-07-04 21:31:47 +00:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
9b2cb012e9 | |||
35102b4ad5 | |||
192c65f09a | |||
dda0204ec0 | |||
1096d15a16 | |||
615a966d6a | |||
171a561537 | |||
fa62838777 | |||
bb2f23633d | |||
d472664924 |
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@ -0,0 +1,13 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "4.0"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
before_install:
|
||||
- npm i -g npm
|
||||
# Workaround for a permissions issue with Travis virtual machine images
|
||||
script:
|
||||
- npm test
|
20
README.md
20
README.md
@ -1,7 +1,7 @@
|
||||
ipfs-peer-id Node.js implementation
|
||||
===================================
|
||||
peer-id Node.js implementation
|
||||
==============================
|
||||
|
||||
[](http://webchat.freenode.net/?channels=%23ipfs)
|
||||
[](http://ipn.io) [[](http://webchat.freenode.net/?channels=%23ipfs) ](https://travis-ci.org/diasdavid/node-peer-id)  [](https://david-dm.org/diasdavid/node-peer-id) [](https://github.com/feross/standard)
|
||||
|
||||
> IPFS Peer Id implementation in Node.js
|
||||
|
||||
@ -14,7 +14,7 @@ A IPFS Peer Id is based on a sha256 has of the peer public key, using [multihash
|
||||
### Installing
|
||||
|
||||
```
|
||||
$ npm install ipfs-peer-id
|
||||
$ npm install peer-id
|
||||
```
|
||||
|
||||
### Creating a new Id
|
||||
@ -23,22 +23,22 @@ $ npm install ipfs-peer-id
|
||||
var PeerId = require('ipfs-peer')
|
||||
|
||||
// Create a new Id
|
||||
var id = new Id.create()
|
||||
var id = new PeerId.create()
|
||||
|
||||
// Recreate an Id from Hex string
|
||||
var id = new Id.createFromHexString(str)
|
||||
var id = new PeerId.createFromHexString(str)
|
||||
|
||||
// Recreate an Id from a Buffer
|
||||
var id = new Id.createFromBytes(buf)
|
||||
var id = new PeerId.createFromBytes(buf)
|
||||
|
||||
// Recreate an B58 String
|
||||
var id = new Id.createFromB58String(str)
|
||||
var id = new PeerId.createFromB58String(str)
|
||||
|
||||
// Recreate from a Public Key
|
||||
var id = new Id.createFromPubKey(pubKey)
|
||||
var id = new PeerId.createFromPubKey(pubKey)
|
||||
|
||||
// Recreate from a Private Key
|
||||
var id = new Id.createFromPrivKey(privKey)
|
||||
var id = new PeerId.createFromPrivKey(privKey)
|
||||
```
|
||||
|
||||
### Exporting an Id
|
||||
|
19
package.json
19
package.json
@ -1,12 +1,14 @@
|
||||
{
|
||||
"name": "ipfs-peer-id",
|
||||
"version": "0.3.0",
|
||||
"name": "peer-id",
|
||||
"version": "0.3.3",
|
||||
"description": "IPFS Peer Id implementation in Node.js",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"test": "./node_modules/.bin/lab tests/*-test.js",
|
||||
"coverage": "./node_modules/.bin/lab -t 100 tests/*-test.js",
|
||||
"codestyle": "./node_modules/.bin/standard --format"
|
||||
"codestyle": "./node_modules/.bin/standard --format",
|
||||
"lint": "jshint .",
|
||||
"validate": "npm ls"
|
||||
},
|
||||
"keywords": [
|
||||
"IPFS"
|
||||
@ -17,14 +19,17 @@
|
||||
"codestyle",
|
||||
"test"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/diasdavid/node-ipfs-peer-id/issues"
|
||||
"engines": {
|
||||
"node": "^4.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/diasdavid/node-ipfs-peer-id",
|
||||
"bugs": {
|
||||
"url": "https://github.com/diasdavid/node-peer-id/issues"
|
||||
},
|
||||
"homepage": "https://github.com/diasdavid/node-peer-id",
|
||||
"devDependencies": {
|
||||
"code": "^1.4.1",
|
||||
"lab": "^5.13.0",
|
||||
"precommit-hook": "^3.0.0",
|
||||
"pre-commit": "^1.1.1",
|
||||
"standard": "^4.5.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
Reference in New Issue
Block a user