tap-object-stream
Quickly tap into properties of streamed objects.
Install
npm i tap-object-stream --save
Examples
Single return value
var tap = // By introspection, the function parameter // names are mapped to object properties
Multiple return values
// Add "done" as a parameter
Go deep
// Properties don't have to exist beforehand
Filter objects in a stream
var stream = // Will only output the blue and green objectsstream streamstreamstreamstream
Available methods:
done.include()
ordone.exclude(false)
done.include(false)
ordone.exclude()
To emit an error and stop streaming, use:
done.assert()
ordone.refute(false)
done.assert(false)
ordone.refute()