It really depends on what you want to achieve.
This is one potential
// returns and Observable which emits every time a file is read - emitted values are:// - the name of the file read// - an array containing the lines of the file as stringsexport function readFilesObservable(fileList: Array<string>) { return Observable.from(fileList) .mergeMap(file => _readFileObservable(file))}const _readFileObservable = Observable.bindCallback(_readLines, (fileFullName: string, lines: Array<string>) => ({fileFullName, lines}));function _readLines(fileFullName: string, callback: (file: string, lines: Array<string>) => void) { const lines = new Array<string>(); const rl = readline.createInterface({ input: fs.createReadStream(fileFullName), crlfDelay: Infinity }); rl.on('line', (line: string) => { lines.push(line); }); rl.on('close', () => { callback(fileFullName, lines); })}