📜  从流中提取读取缓冲区 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:32.751000             🧑  作者: Mango

代码示例1
// lets have a ReadableStream as a stream variable

const chunks = [];

for await (let chunk of stream) {
    chunks.push(chunk)
}

const buffer  = Buffer.concat(chunks);
const str = buffer.toString("utf-8")