Problem Statement
How does Node.js handle large file streaming efficiently?
Explanation
Using streams allows data to be processed in chunks instead of loading the entire file into memory. This improves performance and reduces memory usage, especially for videos or large logs.
Code Solution
SolutionRead Only
fs.createReadStream('video.mp4').pipe(res);