lib/readLines.js
function readLines(path, callback) {
    return new Promise(function(resolve, reject) {
        const stream = fsExtra.createReadStream(path);
        stream.on('error', reject);
        stream.on('end', resolve);

        const lineReader = readline.createInterface({
            input : stream
        });
        lineReader.on('line', callback);
    });
}
function readLines(path, callback) {
    return new Promise(function(resolve, reject) {
        const stream = fsExtra.createReadStream(path);
        stream.on('error', reject);
        stream.on('end', resolve);

        const lineReader = readline.createInterface({
            input : stream
        });
        lineReader.on('line', callback);
    });
}
function readLines ( path , callback ) { return new Promise ( function ( resolve , reject ) { const stream = fsExtra . createReadStream ( path ) ; stream . on ( 'error' , reject ) ; stream . on ( 'end' , resolve ) ; const lineReader = readline . createInterface ( { input : stream } ) ; lineReader . on ( 'line' , callback ) ; } ) ; }
Read a file line-by-line.

@param {String} path Path to the file.
@param {Function} callback Function to call when reading each line.
@returns {Promise} A promise when the reader is finished.

@private
Read a file line - by - line .