Answers for "creating a read stream from a large text file"

0

creating a read stream from a large text file

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...');
});
Posted by: Guest on May-16-2021

Code answers related to "creating a read stream from a large text file"

Code answers related to "Javascript"

Browse Popular Code Answers by Language