UNPKG

@naturalcycles/nodejs-lib

Version:
15 lines 545 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const __1 = require("../.."); const pipeline_1 = require("./pipeline"); /** * Wrapper around stream.pipeline() that will collect all results as array and emit it with Promise in the end. * Will throw on error. */ async function pipelineToArray(streams, opt) { const res = []; await pipeline_1._pipeline([...streams, __1.writablePushToArray(res, opt)]); return res; } exports.pipelineToArray = pipelineToArray; //# sourceMappingURL=pipelineToArray.js.map