0.0.1 • Published 8 years ago

@klortho/line-reader v0.0.1

Weekly downloads
-
License
WTFPL
Repository
github
Last release
8 years ago

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.