Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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...');
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: momen js get time zone code from location name 
Javascript :: how to find dublicates in string 
Javascript :: solutions on Multiply - Declaring a Function as a Variable 
Javascript :: 1.047222170078745 
Javascript :: jackson jsonpath 
Javascript :: complete date 
Javascript :: stop playing music when page is closed react 
Javascript :: check if div is collpased jqeruy 
Javascript :: how to edit local json files using node 
Javascript :: get all youtube playlist videos as json without api python 
Javascript :: Utils is not a constructor MuiPickersUtilsProvider 
Javascript :: new date in interpolation angular 
Javascript :: ts(2749) react testing library 
Javascript :: 4.1.1. More On Strings¶ 
Javascript :: Checking equality with Promise.resolve vs async return 
Javascript :: filter object javascript es6 
Javascript :: key being passed as prop react 
Javascript :: javascript average of float array 
Javascript :: how to convert variable to string in jquery 
Javascript :: how to push object in array in angular from an api 
Javascript :: javascript debugging methods 
Javascript :: how to make a website send form to you 
Javascript :: format large texts 
Javascript :: amcryption npm package 
Javascript :: client.guilds foreach 
Javascript :: CSS overflow table row positioning 
Javascript :: default values not applied on findoneandupdate mongoose 
Javascript :: how to break out of foreach jstl 
Javascript :: javascripts 3 months daterange 
Javascript :: bootstrap modal show on page load without jquery 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =