Memo on how to use stream in Node.js

When processing data, we tend to be lazy and read all the data into memory before processing it. This is not a problem when the data size is small, but when dealing with huge data, it consumes a lot of memory and takes a long time because other read/write operations are blocked until reading or wri…