@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
16 lines (15 loc) • 415 B
JavaScript
;
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;