📅  最后修改于: 2022-03-11 15:03:38.438000             🧑  作者: Mango
import { createReadStream, ReadStream } from 'fs';
var readStream: ReadStream = createReadStream('./data.txt');
readStream.on('data', chunk => {
console.log('---------------------------------');
console.log(chunk);
console.log('---------------------------------');
});
readStream.on('open', () => {
console.log('Stream opened...');
});
readStream.on('end', () => {
console.log('Stream Closed...');
});