scuttlebutt-stream

An easier way to work with Scuttlebutt streams

npm install scuttlebutt-stream
2 downloads in the last week
8 downloads in the last month

Scuttlebutt Stream

An easier way to deal with scuttlebutt streams.

var scuttlebutt = require('scuttlebutt-stream');
var Model       = require('scuttlebutt/model');

var m1 = new Model();
var s1 = m1.createStream();

var m2 = new Model();
var s2 = m2.createStream();

var scs = scuttlebutt(function(data) {
    this.queue([ data[0], 'Foo' ]);
});

s1.pipe(scs).pipe(s2);

m1.set('name', 'Drew');

process.nextTick(function() {
    console.log(m1.get('name'), m2.get('name'));
});
npm loves you