&gt; The problem with this is to be able to add a custom function to this pipeline, you have to extend the prototype of the library with your own functions, or re-implement it.<p>That&#x27;s <i>exactly</i> what transducers try to solve, and fortunately they do exist for js (<a href="http:&#x2F;&#x2F;jlongster.com&#x2F;Transducers.js--A-JavaScript-Library-for-Transformation-of-Data" rel="nofollow">http:&#x2F;&#x2F;jlongster.com&#x2F;Transducers.js--A-JavaScript-Library-fo...</a>) where processing of individual elements is separated from plumbing, so you can add your own custom computation in the chain. It even has pretty good performances (<a href="http:&#x2F;&#x2F;jlongster.com&#x2F;Transducers.js-Round-2-with-Benchmarks" rel="nofollow">http:&#x2F;&#x2F;jlongster.com&#x2F;Transducers.js-Round-2-with-Benchmarks</a>), all with the standard data structures !<p>Of course transducers are useful only when you want to <i>transform</i> data, not when you want to act on them in the chain.