import { createReadStream, ReadStream } from 'fs'; var readStream: ReadStream = createReadStream('./data.txt'); setTimeout(() => { const data = readStream.read(10); console.log(data); }, 10);