Process batches of SSB messages with promises.
const ssbReader = require('ssb-reader')
ssbReader({
name: `vacuum`,
max: 1000,
write: (messages) => new Promise((resolve) => {
console.log(messages)
resolve()
})
})
ssb-reader wants write access to $HOME/.config/ssb-to-pubsub/status.json so it can save the timestamp of the last processed message. This allows it to pick up where it left off after a restart.
git clone https://github.com/planetary-social/ssb-reader.git
cd ssb-reader
With npm:
npm install
With yarn:
yarn
Apache-2.0