Byte Length
Get the response length of a Koa response body, streams in particular.
app app
byteLength
is added to this.response
.
If a non-stream body is set,
this is the content-length
.
If a stream body is set,
this is the current amount of bytes sent to the response.
To find the total amount of bytes sent,
check the byteLength
property after the response emits the finish
event:
app app
You may also use it as a function, though it's still a generator even though it's not async.
var byteLength = app