Commit 37dd79180ddcb9c8d358a3461b4ab27d7cc27e4f
tweak readme
Paul Frazee committed on 3/10/2015, 9:09:30 PMParent: 0a0f0519d65854f70324178bc08739658ca3a62e
Files changed
README.md | changed |
README.md | ||
---|---|---|
@@ -4,26 +4,28 @@ | ||
4 | 4 … | |
5 | 5 … | ```js |
6 | 6 … | |
7 | 7 … | var Client = require('ssb-client') |
8 | -var ssbKeys = require('ssb-keys') | |
8 … | +var Keys = require('ssb-keys') | |
9 | 9 … | |
10 | 10 … | // desktop app: |
11 | -var keys = ssbKeys.loadOrCreateSync('./app-private.key') | |
11 … | +var keys = Keys.loadOrCreateSync('./app-private.key') | |
12 | 12 … | |
13 | 13 … | // web app: |
14 | 14 … | var keys |
15 | 15 … | try { |
16 | 16 … | keys = JSON.parse(localStorage.keys) |
17 | 17 … | } catch (e) { |
18 | - keys = ssbKeys.generate() | |
18 … | + keys = Keys.generate() | |
19 | 19 … | localStorage.keys = JSON.stringify(keys) |
20 | 20 … | } |
21 | 21 … | |
22 … | +// connect: | |
22 | 23 … | var client = Client(keys, config) |
23 | 24 … | .connect(abortIf) |
24 | - .auth(ssbKeys.createAuth(keys), abortIf) | |
25 … | + .auth(Keys.createAuth(keys), abortIf) | |
25 | 26 … | |
27 … | +// post to feed: | |
26 | 28 … | var feed = client.createFeed(keys) |
27 | 29 … | feed.add({ |
28 | 30 … | type: 'post', text: 'hello, world!' |
29 | 31 … | }, function (err, msg) { |
Built with git-ssb-web