What's happening here is that we get a stream and need to return results based on what happens in that stream.

The stream can go "readable" but not actually have any data in it.  There's no way to know that difference in a "readable" event handler.  Right now, I am returning a 404 if the stream ended up empty ("end" happens without any "data" happening).  Writing the start of the array in "readable" would mean that I return an empty array instead of a 404.  Which is actually maybe not the worst thing in the world.

Secondly, though, each item in the array needs to be followed by a "," at a minimum (I'm adding a new-line as well just to make it pretty).  The only way I know how to do this in a streaming manner is to pre-pend it on everything ***except*** the first element, and the only way I know of to implement that is with a state flag like this.  Right now, the state flag has more semantics than just "first element written", but the fact that one would be required doesn't actually change.

Is that enough to convince you that this is ok, or would you prefer I start the array in "readable" anyway and reduce the semantics of the flag?