A line parsing library for Node.js. Parses stream of "chunks" of data into lines.
CoffeeScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec
.gitignore
Cakefile
line-parser.coffee
line-parser.js
package.json
readme.md

readme.md

this is pre-release, alpha. just saying.

Installation

  • npm install line-parser

Overview

line-parser takes a stream of "chunks" and outputs full lines (as delimited by \n) as events.

Usage

var LineParser = require("line-parser")

var myParser = new LineParser()

myParser.on("line", function(line){
  console.log(line);
});

myParser.chunk("This is not a ");
myParser.chunk("line until we see a newline.\nSo we will only get two lines emitted");
myParser.chunk(" from this excercise.\n");

#will output
#This is not a line until we se a newline.
#So we will only get two lines emitted from this excercise.

Global dependancies for building/testing

  • jasmine-node (npm install jasmine-node -g)
  • coffee-script (npm install coffee-script -g)

To run tests

  • cake build && cake test

To build javascript library

  • cake build