BrowserStream
use Stream#pipe
to send data to clients or servers.
wrap socket.io
(or another web socket abstraction that gives a remote EventEmitter
api)
with a interface for creating streams.
install
npm install browser-stream
example
client
var bs = iovar domnode = //see https://github.com/maxogden/dominodevar opts = options: 'pass an optional object with the createReadStream message. maybe useful!')//pipe the 'whatever' stream to the dom with dominode.bs
server
io = io //see https://github.com/LearnBoost/socket.iovar _bs =iosockets
this will connect whatever
to the Dominode
stream, rendering it, in the browser!
API
var _bs =iosockets
createReadStream (name, options)
open a ReadableStream
from the other side.
returns a ReadableStream
.
the other side of connection will emit a writable stream that is connected to this stream.
createWriteStream (name, options)
open a WritableStream
to the other side.
returns a WritableStream
, the other side will emit a ReadableStream
connected to this stream.
createStream (name, options)
open a Stream
to the other side which is both readable and writable.
returns a Stream
, the other side will emit a Stream
connected to this stream.
note to self, references to a class (
Stream
) should be capitalized, and in backticks. references to an instance should be lowercase, and not in backticks unless refuring to a specific variable in a code example.