@h4ad/node-modules-packer
Version:
<h1 align="center"> 🚀 Node Modules Packer </h1>
16 lines • 635 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.streamToUInt8Array = void 0;
function streamToUInt8Array(stream) {
const chunks = [];
return new Promise((resolve, reject) => {
stream.on('data', chunk => chunks.push(Buffer.from(chunk)));
stream.on('error', err => reject(err));
stream.on('end', () => {
const b = Buffer.concat(chunks);
resolve(new Uint8Array(b.buffer, b.byteOffset, b.byteLength / Uint8Array.BYTES_PER_ELEMENT));
});
});
}
exports.streamToUInt8Array = streamToUInt8Array;
//# sourceMappingURL=string-to-uint.js.map