2.0.1 • Published 6 months ago

hypercore-byte-stream v2.0.1

Weekly downloads
372
License
Apache-2.0
Repository
github
Last release
6 months ago

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

2.0.1

6 months ago

2.0.0

6 months ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago