Commit 2fcaca5f1bcf24281ce88c95e66a42e5aa553605
Merge pull request #8 from ssbc/readme-improvements
update readme for clarityPaul Frazee committed on 1/18/2016, 8:31:16 PM
Parent: 69a6a76036c364846db285cd00c9434226a518c7
Parent: a75a9f03c984e9678af65100c3cf1e2417bf9422
Files changed
README.md | changed |
README.md | ||
---|---|---|
@@ -1,24 +1,36 @@ | ||
1 | 1 | # ssb-feed |
2 | 2 | |
3 | -appendable to an ssb feed. | |
3 | +A publishing interface for scuttlebutt feeds. | |
4 | 4 | |
5 | +By default, [Scuttlebot](https://ssbc.github.io/scuttlebot/) uses a "master" identity/feed, which `sbot.publish()` will append new messages to. If you want to manipulate additional feeds, you can load the keypair and then use this library to do so. | |
6 | + | |
5 | 7 | ## Example |
6 | 8 | |
7 | 9 | ``` js |
8 | 10 | |
9 | -var Feed = require('ssb-feed') | |
10 | -//can be a client instance, or a local scuttlebot instance. | |
11 | -var ssbc = require('ssb-client')() | |
11 | +var ssbFeed = require('ssb-feed') | |
12 | +var ssbClient = require('ssb-client') | |
12 | 13 | var ssbKeys = require('ssb-keys') |
13 | 14 | |
14 | 15 | var alice = ssbKeys.generate() |
15 | -var f = Feed(ssbc, alice) | |
16 | +ssbClient(function (err, sbot) { | |
17 | + var feed = ssbFeed(sbot, alice) | |
16 | 18 | |
17 | -//post to alice's feed. | |
18 | -f.publish({type: 'post', text: 'hello world, I am alice.'}, function (err) {}) | |
19 | + // Post to alice's feed | |
20 | + feed.publish({ | |
21 | + type: 'post', | |
22 | + text: 'hello world, I am alice.' | |
23 | + }, function (err) { ... }) | |
24 | + | |
25 | + // Also available: | |
26 | + console.log(feed.id) | |
27 | + console.log(feed.keys) | |
28 | +}) | |
19 | 29 | ``` |
20 | 30 | |
31 | +This example uses `ssb-client`, but, if you're embedding `scuttlebot` or the `secure-scuttlebutt` library into your process, you can use them locally. | |
32 | + | |
21 | 33 | ## License |
22 | 34 | |
23 | 35 | MIT |
24 | 36 |
Built with git-ssb-web