Files: c9612c202e02ee707d278a8a812b4f2e9b16b568 / example.js
343 bytesRaw
1 | |
2 | var Client = require('./') |
3 | |
4 | var config = require('ssb-config') |
5 | var ssbKeys = require('ssb-keys') |
6 | var keys = ssbKeys.loadOrCreateSync(config) |
7 | |
8 | function abortIf (err) { |
9 | if(err) throw err |
10 | } |
11 | |
12 | var client = Client(keys, config) |
13 | .connect(abortIf) |
14 | |
15 | client.whoami(function (err, whoami) { |
16 | abortIf(err) |
17 | console.log(whoami) |
18 | client.close() |
19 | }) |
20 |
Built with git-ssb-web