Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

documented constructor options

  • Loading branch information...
commit 51e8eb4c2c471e86a30570efdc7a8d9c9202c20d 1 parent 1415f6a
Pedro Teixeira authored

Showing 3 changed files with 17 additions and 2 deletions. Show diff stats Hide diff stats

  1. +11 0 README.markdown
  2. +1 1  lib/carrier.js
  3. +5 1 package.json
11 README.markdown
Source Rendered
@@ -31,3 +31,14 @@ Or, you can also listen to the "line" event on the returned object of carrier.ca
31 31 });
32 32 });
33 33 server.listen(4001);
  34 +
  35 +carrier.carry accepts the following options:
  36 +
  37 + carrier.carry(reader, listener, encoding, separator)
  38 +
  39 +* reader: the stream reader
  40 +* listener: a "line" event listener function
  41 +* encoding: what encoding to assume. Default: "utf8"
  42 +* separator: what line separator to use. Default: /\r?\n/
  43 +
  44 +All are optional except for the first.
2  lib/carrier.js
@@ -16,7 +16,7 @@ function Carrier(reader, listener, encoding, separator) {
16 16
17 17 var buffer = '';
18 18
19   - reader.setEncoding(encoding || 'utf-8');
  19 + reader.setEncoding(encoding || 'utf8');
20 20 reader.on('data', function(data) {
21 21 var lines = (buffer + data).split(separator);
22 22 buffer = lines.pop();
6 package.json
... ... @@ -1,6 +1,6 @@
1 1 { "name" : "carrier"
2 2 , "description" : "Evented stream line reader for node.js"
3   -, "version" : "0.1.6"
  3 +, "version" : "0.1.7"
4 4 , "homepage" : "http://github.com/pgte/carrier"
5 5 , "author" :
6 6 {
@@ -17,6 +17,10 @@
17 17 "name": "Stéphan Kochen"
18 18 , "email": "stephan@kochen.nl"
19 19 }
  20 + , {
  21 + "name": "Patrick Georgi"
  22 + , "url": "https://github.com/pgeorgi"
  23 + }
20 24 ]
21 25 , "repository" :
22 26 { "type" : "git"

0 comments on commit 51e8eb4

Please sign in to comment.
Something went wrong with that request. Please try again.