Google News
logo
NodeJS - Interview Questions
What is the difference between readFile and createReadStream in Node.js ?
readFile : This is used to read all of the contents of a given file in an asynchronous manner. All of the content will be read into the memory before users can access it.

create ReadStream : This is used to break up the field into smaller chunks and then read it. The default chunk size is 64 KB, and this can be changed as per requirement.
Advertisement