Skip to content

intesso/new-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

new-line

simple new line stream for node.js stream2 it also handles files (streams) that contain bytes > 0x7f (binary files) gracefully, and does not change the bytes, other than e.g. split or split2.

install

npm install new-line

# for node 0.8 also install:
npm install readable-stream

use

var fs = require('fs');
var newLineStream = require('new-line');
var source = fs.createReadStream('./package.json');
var target = fs.createWriteStream('./out.json');
var newLine = newLineStream();
source.pipe(newLine).pipe(target);

var nr = 0;
newLine.on('line', function(line) {
  console.log(++nr + ': ' + line);
});

test

npm test

license

MIT

About

simple new line stream for node.js stream2

Resources

License

Stars

Watchers

Forks

Packages

No packages published