【发布时间】:2018-07-15 09:42:25
【问题描述】:
我有一个数组,我希望将其转换为可读流。为此,我使用stream-array NPM 模块。
当我尝试使用 node.js 10 async-iterators 遍历流时
const streamify = require('stream-array');
const readable = streamify(list);
for await (let chunk of readable) {
...
}
我收到以下错误:
TypeError: readable is not async iterable
但是对于常规的fs 流,它可以正常工作。
【问题讨论】:
标签: javascript node.js stream async-await