UNPKG

@naturalcycles/nodejs-lib

Version:
16 lines (15 loc) 415 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readableToArray = void 0; /** * Convenience function to read the whole Readable stream into Array (in-memory) * and return that array. */ async function readableToArray(readable) { const a = []; for await (const item of readable) { a.push(item); } return a; } exports.readableToArray = readableToArray;