liner

    1.0.1 • Public • Published

    node-liner

    Build Status

    This is a simple Node.js module that reads lines from files and streams. There are other similar modules, but I believe they are more complicated than they need to be.

    Example

    const Liner = require('liner');
    const liner = new Liner('./story.txt');
    
    liner.on('readable', () => {
      while (true) {
        const line = liner.read();
        if (line === null) break;
        // Do something with line.
        console.log(line);
      }
    });
    
    liner.on('error', err => console.error(err));
    
    liner.on('end', () => process.exit(0));
    

    Keywords

    none

    Install

    npm i liner

    DownloadsWeekly Downloads

    8

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • mvolkmann