jsonwire
newline delimited json read/write stream
Last updated 8 years ago by shtylman .
Repository · Original npm · Tarball · package.json
$ cnpm install jsonwire 
SYNC missed versions from official npm registry.

jsonwire

newline delimited json messages read/write stream

var socket;

var app = through(function(msg) {
    // handle parsed objects here
});

var wire;
socket.pipe(wire = jsonwire(app)).pipe(socket);

wire.on('error', function(err) {
    // some parsing or other error
    // pipes are disconnected now
    // up to you to reconnect
});

// app just emits whatever it wants sent
app.emit('data', {foo:'bar'});

Current Tags

  • 0.0.0                                ...           latest (8 years ago)

1 Versions

  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (1)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |