mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-07-01 23:41:49 +00:00
* refactor: make import and creation async - This allows the use of native key generation in the browser BREAKING CHANGE: This changes the interface of .create, .createFromPrivKey, .createFromPubKey, .createFromJSON
14 lines
191 B
JavaScript
Executable File
14 lines
191 B
JavaScript
Executable File
#!/usr/local/bin/node
|
|
|
|
'use strict'
|
|
|
|
const PeerId = require('./index.js')
|
|
|
|
PeerId.create((err, id) => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
|
|
console.log(JSON.stringify(id.toJSON(), null, 2))
|
|
})
|