hypercore-sparse-index
Index blocks as they're downloaded
Last updated 4 years ago by emilbay .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hypercore-sparse-index 
SYNC missed versions from official npm registry.

WIP hypercore-sparse-index

Index blocks as they're downloaded

Note: This module is strongly limited in that it only indexes blocks on startup and as they're downloaded. Meaning it will not index new blocks as they're appended

Usage

'use strict'

var memdb = require('memdb')
var hypercore = require('hypercore')
var sparseIndex = require('hypercore-sparse-index')

var feed = hypercore(memdb()).createFeed('feed-key-from-somewhere', {sparse: true})

sparseIndex({
  db: memdb(),
  feed: feed
}, function (entry, next) {
  console.log(entry)

  next()
}, function (err) {
  console.error(err)
})

feed.get(0, function () {})
feed.get(1, function () {})
feed.get(2, function () {})

API

HypercoreSparseIndex(opts, onentry, [onerror])

{
  db, // Level instance
  feed // Hypercore feed
}

License

ISC

Current Tags

  • 0.0.0                                ...           latest (4 years ago)

1 Versions

  • 0.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (3)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |