Problem Statement
What is the difference between readFile and createReadStream?
Explanation
`fs.readFile()` reads the entire file into memory before processing, making it suitable for small files. `fs.createReadStream()` reads chunks of data as streams, ideal for large files or real-time data transfer.
Code Solution
SolutionRead Only
fs.createReadStream('large.txt').pipe(fs.createWriteStream('copy.txt'));