wrap-scuttlebutt-stream
v0.1.0
Published
Transition utility to create JSONStream-wrapped scuttlebutt streams
Downloads
7
Readme
wrap-scuttlebutt-stream
Transition utility to create JSONStream-wrapped scuttlebutt streams. Because scuttlebutt's stream-serializer
doesn't play nice with JSONStream, and I'm using JSONStream elsewhere, this disables stream-serializer on scuttlebutt streams and wrap them with JSONStream.
example
const create = require('wrap-scuttlebutt-stream')
const model = require('scuttlebutt/model')()
const stream = create(model, { tail: false })
Alternatively:
const wrap = require('wrap-scuttlebutt-stream')
const model = require('scuttlebutt/model')()
const stream = wrap(model.createStream({ tail: false, wrapper: 'raw' }))
wrap(model||stream, [opts])
Options are passed to model.createStream(opts)
.
install
With npm do:
npm install wrap-scuttlebutt-stream
license
MIT © Vincent Weevers