When i first i looked at readme , i couldnt find the peace of code for the clients, to connect to the the tcp server . I think it would be easier for developers , to see booth server and client example.
Client side example
var Model = require('scuttlebutt/model');
var net = require('net');
var m = new Model;
var s = m.createStream();
s.pipe(net.connect(8888, 'localhost')).pipe(s);
m.on('update', function cb (key) {
// wait until we've gotten at least one count value from the network
if (key !== 'count') return;
m.removeListener('update', cb);
setInterval(function () {
m.set('count', Number(m.get('count')) + 1);
}, 100);
});
m.on('update', function (key, value) {
console.log(key + ' = ' + value);
});
// source http://documentup.com/substack/stream-handbook
When i first i looked at readme , i couldnt find the peace of code for the clients, to connect to the the tcp server . I think it would be easier for developers , to see booth server and client example. Client side example