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));

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i liner

    Weekly Downloads

    32

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • mvolkmann