You can pass all input to the resulting function.
callback is then called with the output of middleware.
If middleware accepts more arguments than the later given in input,
an extra done function is passed to it after that input,
which must be called by middleware.
The first value in input is the main input value.
All other input values are the rest input values.
The values given to callback are the input values,
merged with every non-nullish output value.
if middleware throws an error,
returns a promise that is rejected,
or calls the given done function with an error,
callback is called with that error
if middleware returns a value or returns a promise that is resolved,
that value is the main output value
if middleware calls done,
all non-nullish values except for the first one (the error) overwrite the
output values
If fn returns a promise,
and that promise rejects,
the pipeline fails and done is called with the rejected value.
If fn returns a promise,
and that promise resolves with a value (neither null nor undefined),
the first input of the next function is set to that value (all other input
is passed through).
The following example shows how rejecting a promise stops the pipeline:
If fn accepts one more argument than the given input,
a next function is given (after the input).
next must be called, but doesn’t have to be called async.
If next is given a value (neither null nor undefined) as its first
argument,
the pipeline fails and done is called with that value.
If next is given no value (either null or undefined) as the first
argument,
all following non-nullish values change the input of the following
function,
and all nullish values default to the input.
The following example shows how passing a first argument stops the pipeline:
This projects is compatible with maintained versions of Node.js.
When we cut a new major release,
we drop support for unmaintained versions of Node.
This means we try to keep the current release line,
trough@2,
compatible with Node.js 12.