hypercore-byte-stream

2.0.2 • Public • Published

hypercore-byte-stream

A Readable stream around a Hypercore that supports reading byte ranges.

npm install hypercore-byte-stream

Useful for media streaming

Usage

const ByteStream = require('hypercore-byte-stream')

// id is a blob id that sets the outer bounds for the stream
// should contain the following { blockOffset, blockLength, byteOffset, byteLength }

// options can be used be specify a byte range { start, length }
// other options include, { maxPrefetch }
// note that the stream will close the core session when done, ie it takes full ownership of it
const stream = new ByteStream(core, id, options)

// if the core only contains a single blob you can use the one helper to init the blob id for you
const unboundedStream = ByteStream.one(core, options)

License

Apache-2.0

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.2165latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.2165
2.0.1674
2.0.01
1.0.129
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.11
1.0.01

Package Sidebar

Install

npm i hypercore-byte-stream

Weekly Downloads

851

Version

2.0.2

License

Apache-2.0

Unpacked Size

18.9 kB

Total Files

5

Last publish

Collaborators

  • mafintosh
  • andrewosh