Node.js:修订间差异
来自康健生活
| 第199行: | 第199行: | ||
'/*!\n * Vue.js v2.6.14\n * (c) 2014-2021 Evan You\n * Released under the MIT License.\n */\n!function(e,t){"object"=... | '/*!\n * Vue.js v2.6.14\n * (c) 2014-2021 Evan You\n * Released under the MIT License.\n */\n!function(e,t){"object"=... | ||
</pre>}}}} | </pre>}}}} | ||
其他写法。 | |||
<syntaxhighlight lang="javascript"> | |||
async function streamToString(stream) { | |||
// lets have a ReadableStream as a stream variable | |||
const chunks = []; | |||
for await (const chunk of stream) { | |||
chunks.push(Buffer.from(chunk)); | |||
} | |||
return Buffer.concat(chunks).toString("utf-8"); | |||
}</syntaxhighlight> | |||
=== other === | === other === | ||