Skip to content
tiny utility to process streams line per line
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


this is a tiny utility function to help processing readable streams line per line

here is a simple example which explains almost everything

	var lines = require('lines');
	var net = require('net');
	net.createServer(function(socket) {
	    lines(socket); // here is where the magic happens
	    socket.on('line', function(line) {
		// line is one line with no trailing \n or \r

lines doesn't work on non-encoded streams. note that you still can listen
to 'data' events on the same stream with no loss of data.

install it via npm
	npm install lines

or get the code on and link lines.js from your ~/.node_libraries/

Something went wrong with that request. Please try again.