stream-teleport

1.0.4 • Public • Published

stream-teleport

Travis CI Coverage Status Size Version

Send big files or chunks of data over a stream. Useful to overcome WebRTC data channel message size limit.

Installation

npm install -S stream-teleport

Usage

Use .dematerialize to break a chunk into smaller chunks. Then on the other end use .rematerialize to reassemble it.

Example sending a big file over WebRTC and simple-peer lib:

// On sender machine
const dematerializeStream = streamTeleport.dematerialize({ chunkSize: 1024 })
const fileStream = fs.createReadStream('massive-video.mp4')
fileStream.pipe(dematerializeStream).pipe(peer)
 
// On receiver machine
const rematerializeStream = streamTeleport.rematerialize()
const fileStream = fs.createWriteStream('massive-video.mp4')
peer.pipe(rematerializeStream).pipe(fileStream)

caiogondim.com  ·  GitHub @caiogondim  ·  Twitter @caio_gondim

Readme

Keywords

none

Package Sidebar

Install

npm i stream-teleport

Weekly Downloads

11

Version

1.0.4

License

MIT

Unpacked Size

184 kB

Total Files

10

Last publish

Collaborators

  • caiogondim