Skip to content

A readable stream that gives data line by line from a file

License

Notifications You must be signed in to change notification settings

muqsith/streaming-line-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streaming-line-reader

It will stream lines, so you can wait and write to any source by piping it to output stream (Writable stream). While you wait it doesn't overwhelm your system memory, this is the benefit we get when we use NodeJS Streams. Process huge files with low memory footprint.

    const getReadLineStream = require('streaming-line-reader');

    const inputFile = '/sample/input/file.txt';
    const outputFile = '/sample/output/file.txt';
    const readLineStream = await getReadLineStream(inputFile);
    const writeStream = fs.createWriteStream(outputFile);
    // you can also create your own Writable stream
    readLineStream.pipe(writeStream);

About

A readable stream that gives data line by line from a file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published