Node.js fs.createWriteStream() manages writes using an internal buffer and queue system. When you call write(), the data is added to the queue, and the stream ensures each write completes before starting the next. This sequential processing prevents concurrent writes from overlapping, so even if your async calls trigger multiple writes simultaneously, they’re executed in order.
https://github.com/nodejs/node/blob/main/lib/internal/streams/writable.js