I am a beginner to express.js and I am trying to understand the difference between res.send and res.write ?
res.send is equivalent to res.write + res.end
So the key difference is res.send can be called only once where as res.write can be called multiple times followed by a res.end.
But apart from that res.send is part of Express. It can automatically detect the length of response header.
But there may be be a chance of memory spike with res.send(), in case of large files, our application hangs in between .