"use strict"; const pipe = require("@promistream/pipe"); const fromIterable = require("@promistream/from-iterable"); const simpleSink = require("."); (async () => { let result = await pipe([ fromIterable([ 1, 2, 3, 4, 5 ]), simpleSink(async (value, abort) => { console.log("value seen:", value); }) ]).read(); console.log("result:", result); })(); /* Output: value seen: 1 value seen: 2 value seen: 3 value seen: 4 value seen: 5 result: undefined */