"use strict"; const pipe = require("@promistream/pipe"); const fromIterable = require("@promistream/from-iterable"); const collect = require("@promistream/collect"); const debug = require("./"); (async function () { let result = await pipe([ fromIterable([ 1, 2, 3, 4, 5 ]), debug("example pipeline"), collect() ]).read(); console.log(result); })(); /* Output: [@promistream/debug][example pipeline] read was requested [@promistream/debug][example pipeline] seen value: 1 [@promistream/debug][example pipeline] read was requested [@promistream/debug][example pipeline] seen value: 2 [@promistream/debug][example pipeline] read was requested [@promistream/debug][example pipeline] seen value: 3 [@promistream/debug][example pipeline] read was requested [@promistream/debug][example pipeline] seen value: 4 [@promistream/debug][example pipeline] read was requested [@promistream/debug][example pipeline] seen value: 5 [@promistream/debug][example pipeline] read was requested [@promistream/debug][example pipeline] error thrown in read: EndOfStream: End of iterable reached at _help: 'https://www.npmjs.com/package/error-chain', _promistreamIsEndOfStreamMarker: true, _promistreamVersion: 1 } [ 1, 2, 3, 4, 5 ] */