when we use

node read_avoid_buffer.js | head -c5

we only request 5 data, and when we stop requesting, there will be a
SIGPIPE signal, and throw an error to process.stdout

we then catch the error events and emit process exit events

the exit events will print the times of our read call