Carrier helps you implement new-line terminated protocols over node.js.
The client can send you chunks of lines and carrier will only notify you on each completed line.
Install
$ npm install carrier
Usage
var net = carrier = ; var server = net;server;
Or, you can also listen to the "line" event on the returned object of carrier.carry() like this:
var net = carrier = ; var server = net;server;
carrier.carry accepts the following options:
carrier
- reader: the stream reader
- listener: a "line" event listener function
- encoding: what encoding to assume. Default: "utf8"
- separator: what line separator to use. Default: /\r?\n/
All are optional except for the first.