Difference between createReadStream and readFile in Node.js?

Answer

readFile refers to a fully buffered process in which a response is only returned
when the complete file is pushed into the buffer and read.
In contrast, createReadStream refers to a process only partly buffered and is treated
as an event series with the whole file split into chunks, processed, and then sent back as a response one after the other.
readFile is a more memory-intensive process and can be slow, especially with large files, whereas createReadStream is faster for processing large files.

All react js Questions

Ask your interview questions on react-js

Write Your comment or Questions if you want the answers on react-js from react-js Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---