hypercore-index
Linear asynchronous stateful indexing of a
hypercore feed.

Traverses a hypercore feed in chronologic order and lets you consume each
entry via some asynchronous function. Remembers where you left inside the
feed's db and continues there on later runs.
Example
const hypercore = require('hypercore')
const index = require('hypercore-index')
const core = hypercore(db)
const feed = core.createFeed()
index({
feed: feed,
db: db
}, function onentry (entry, next) {
console.log('entry', entry.toString())
next()
}, function ondone (err) {
if (err) throw err
console.log('Done!')
})
Installation
$ npm install hypercore-index
API
var append = index(opts, onentry, [ondone])
Options:
feed: The hypercore feed. Required.
db: A level db. Required.
start: The first index. Default: 0
end: The last index. Default: Infinity
live: Whether to keep scanning. Default: true, unless you pass opts.end
If you are the feed owner you can use the append(data, callback) method returned to append
data and and wait for it to be indexed
license
MIT