duplex-emitter
Turns a duplex stream into an event emitter.
Create
var s = net; var duplexEmitter = ;var emitter = ;
Emit
You can emit events. They will be serialized (to JSON) and piped to the stream.
emitter; // Send event to the other side
Receive
You can listen for events from the peer:
// Got event from the peeremitter