hypercore-indexed-file
Address a local file or HTTP resource as an indexed Hypercore feed.
Last updated 7 months ago by werle .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hypercore-indexed-file 
SYNC missed versions from official npm registry.

hypercore-indexed-file

Address a local file or HTTP resource as an indexed Hypercore feed.

Installation

$ npm install hypercore-indexed-file

Usage

const feed = file(pathspec, (err) => {
  // file at `pathspec` has been indexed
  // bitfield, tree, and signatures generated
})

API

feed = file(pathspec[, opts[, callback]])

Creates a Hypercore feed with indexing set to true that uses random-access-storage-from to derive the data storage for the created feed from the given pathspec string. When the feed is ready, it will index the file specified at pathspec by streaming the chunks through the feed, generating the bitfield, merkle tree, and signatures.

const feed = file('https://example.com/example.txt', (err) => {
  feed.createReadStream().pipe(process.stdout)
  feed.audit(console.log) // should show `0` invalid nodes
})

License

MIT

Current Tags

  • 0.1.3                                ...           latest (7 months ago)

4 Versions

  • 0.1.3                                ...           7 months ago
  • 0.1.2                                ...           8 months ago
  • 0.1.1                                ...           8 months ago
  • 0.1.0                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |