Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

lordnox/node-linestream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

line-stream

Line-stream breaks any stream into seperate lines

How to Install

npm install line-stream

How to use

First, require line-stream:

var Linestream = require('line-stream');

Now we can parse this script and put linenumbers infront of each line, like cat -n would do

// libs needed for the example
var fs    = require('fs');

stream = new Linestream(fs.createReadStream(__filename));

stream.on('line', function(line, no) {
  console.log(no + ': ' + line);
});

stream.on('end', function() {
  console.log('EOF');
});

stream.on('error', function(err) {});

About

library to read a stream line by line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published