buffer-broadcaster

1.0.0 • Public • Published

buffer-broadcaster

Websocket client for compressing and then broadcasting large buffers.

Install

npm i buffer-broadcaster

Usage

For using the library, you must create a broadcaster using the launchBroadcaster method, as such:

 
const bp = require('buffer-broadcaster')
const port = 7000 // port through where the sockets will be emited
 
const broadcaster = bp.launchBroadcaster(port)
 

Once you've done that, you have on hold a new empity Buffer. As you gather your data, you can append it just like that:

 
broadcaster.appendBuffer(dataBuffer)
 

After you have all the data you need to transmit, you broadcast it, cleaning the buffer on hold.

 
broadcaster.broadcast()
 

Package Sidebar

Install

npm i buffer-broadcaster

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

2.97 kB

Total Files

5

Last publish

Collaborators

  • ygarasab