racer-net

Create racer models over a node.js net connection

npm install racer-net
8 downloads in the last week
17 downloads in the last month

racer-net

Create racer models over a node.js net connection

Usage:

On the server...

var racer = require('racer');
var server = require('net').createServer();
var store = racer.createStore();
var model = racer.createModel();

racer.use(require('racer-net'), {server: server, store: store})

model.subscribe('docs.*', function () {
  model.on('set', 'docs.*.name', function (id, name) {
    console.log(id, name);
  });
});

server.listen(8888)

On the client...

var racer = require('racer');
racer.use(require('racer-net'), {client: true});
var model = racer.remoteModel(8888);
model.set('docs.1.name', 'rook');
npm loves you