@libp2p/peer-id 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -38,11 +38,12 @@ A basic implementation of a peer id
38
38
  ## Example
39
39
 
40
40
  ```JavaScript
41
- import { PeerId } from '@libp2p/peer-id'
41
+ import { peerIdFromString } from '@libp2p/peer-id'
42
42
 
43
- const id = new PeerId(...)
43
+ const peer = peerIdFromString('k51qzi5uqu5dkwkqm42v9j9kqcam2jiuvloi16g72i4i4amoo2m8u3ol3mqu6s')
44
44
 
45
- console.log(id.toCid())
45
+ console.log(peer.toCid()) // CID(bafzaa...)
46
+ console.log(peer.toString()) // "12D3K..."
46
47
  ```
47
48
 
48
49
  ## API Docs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/peer-id",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Implementation of @libp2p/interface-peer-id",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p-peer-id/tree/master/packages/libp2p-peer-id#readme",