The latter two of these are out parameters in C, and the most efficient way to map that to a JavaScript API is to return a composite value instead. We use a tuple for performance reasons: Node-API (unlike V8) doesn't have an API to efficiently construct objects with a fixed set of properties.
Composite return value for streaming (de)compression functions.
These functions effectively return three values:
returnValue
: the function's normal return valuedstProduced
: the number of bytes written to the output buffersrcProduced
: the number of bytes read from the input buffer