Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function readLines(filename: string, encoding: BufferEncoding = 'utf8') {
try {
const content = await readFile(filename, encoding);
return toIterableIterator(content.split(/\r?\n/g));
} catch (e) {
return Promise.reject(e);
}
}