The contract for Stream.prototoype.write() specifies a boolean return value. Right now we return undefined, which isn't legal.
My thoughts are as follows:
If we are silent, the callback can return a boolean instead of a string. There is no point to returning a string in silent mode, since we won't be doing anything with it. If the user returns false, they will need to emit the drain event themselves when they are ready to receive more data.
If we are silent, default to returning true. There is basically no need to buffer.
If we are not silent. Return whatever stdout.write returns.
The contract for
Stream.prototoype.write()
specifies aboolean
return value. Right now we returnundefined
, which isn't legal.My thoughts are as follows:
boolean
instead of a string. There is no point to returning a string in silent mode, since we won't be doing anything with it. If the user returnsfalse
, they will need to emit thedrain
event themselves when they are ready to receive more data.true
. There is basically no need to buffer.stdout.write
returns.I have a fix in the works already.