diff options
author | TylerSchroederWM <75996872+TylerSchroederWM@users.noreply.github.com> | 2021-01-24 17:16:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 17:16:16 -0500 |
commit | 84070e4e68685b7741a0c376e9b0f2764ac63c63 (patch) | |
tree | 87bef53f035ce3433f5ce005d1e2a947279b7e76 | |
parent | 7a5961d19c5df9c44edbcbbd6cf344288bbaf2df (diff) | |
download | ssb-logbook-84070e4e68685b7741a0c376e9b0f2764ac63c63.tar.gz ssb-logbook-84070e4e68685b7741a0c376e9b0f2764ac63c63.zip |
added readme
-rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..b14de57 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# logbook-channels + +logbook-channels is a utility to unify the two ways of adding messages to channels in Scuttlebutt: hashtags and channel headers. + +The files in the repo are as follows: +- **pull-many-v2.js** is a utility that must be in the same directory as either *channels-v2.js* or *channels-lib.js*. +- **channels-v2.js** is a standalone command line utility. To print all messages in the `logbook` channel, run `node channels-v2.js logbook`. +- **channels-lib.js** provides channel messages from a pull-stream. Example usage would be: + +``` +const pull = require("pull-stream"); +const clientFactory = require("ssb-client"); +const channels = require("./channels-lib"); + +clientFactory(function(err, client) { + if(err) throw err; + channel.getMessages(client, "logbook", function(messageStream) { + pull(messageStream, pull.drain(function(msg) { + console.log(JSON.stringify(msg)); + }) + }); +}); +``` |