@klortho/line-reader
v0.0.1
Published
line-by-line file reader that returns a promise
Downloads
1
Readme
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.