JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2292
  • Score
    100M100P100Q124914F
  • License Apache-2.0

A Readable stream around a Hypercore that supports reading byte ranges

Package Exports

  • hypercore-byte-stream
  • hypercore-byte-stream/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hypercore-byte-stream) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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