1.

Explain the difference between readFile and createReadStream in Node.js?

Answer»

Node.js is a runtime framework that has turned out to be FAMOUS with most coders and is utilized generally for creating server-side applications. Node.js is best known for making CONSTANT APIs and building another network of interoperability over the web. There are two manners by which a record can be perused and sent for execution in Node.js; readFile and CreateStream. Please see a few major differences in readfile and createStream as below:- 

  1. readFile load the entire record which you had set APART to peruse though createReadStream peruses all records in the parts of the size you have proclaimed.  
  2. The customer will get the information quicker on account of createReadStream interestingly with readFile.  
  3. In readFile, a record will first totally peruse by memory and after that moves to a customer yet in later CHOICE, a document will be perused by memory in a SECTION which is sent to customers and the procedure proceeds until every one of the parts is wrapped up. 


Discussion

No Comment Found