@klortho/line-reader

0.0.1 • Public • Published

line-reader

A very simple Node.js module that reads a file line-by-line, and returns a Promise. The constructor takes a callback function that's called once for each line. The returned Promise resolves when the reading is done.

Example:

var emails = [];
lineReader('email-list.txt', function(line) {
  emails.push(line);
})
.then(
  function() {
    // do something with emails
  },
  function(err) {
    // uh-oh
  }
)

Readme

Keywords

none

Package Sidebar

Install

npm i @klortho/line-reader

Weekly Downloads

2

Version

0.0.1

License

WTFPL

Last publish

Collaborators

  • klortho