@klortho/line-reader

v0.0.1
line-by-line file reader that returns a promise

line-reader

On npm here.

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

License

See LICENSE.txt.

npm i @klortho/line-reader

Metadata

  • WTFPL
  • Whatever
  • Chris Maloney
  • released 1/28/2016

Downloads

Maintainers