These APIs use implicit chunking using defaultChunkSize and currently there is no way to control the buffer size. We can supply the buffer size as a configuration option, but it is easier to use explicit chunking using stream APIs instead, that gives better control. For example, we can also use timedChunksOf API to flush the buffer after a timeout. If we incorporate all such possibilities into the configuration, that complicates the API. So use streaming directly instead.
pipeChars also has the encoding issue, we assume UTF-8 encoding. If we use streaming APIs directly then we have the option to use any encoding or decide it based on the environment.
These APIs use implicit chunking using
defaultChunkSizeand currently there is no way to control the buffer size. We can supply the buffer size as a configuration option, but it is easier to use explicit chunking using stream APIs instead, that gives better control. For example, we can also usetimedChunksOfAPI to flush the buffer after a timeout. If we incorporate all such possibilities into the configuration, that complicates the API. So use streaming directly instead.pipeChars also has the encoding issue, we assume UTF-8 encoding. If we use streaming APIs directly then we have the option to use any encoding or decide it based on the environment.