'use strict';
const { Readable } = require('stream');
const r = new Readable({
objectMode: true,
read() {
this.push('asdf');
this.push('hehe');
this.push(null);
}
});
(async () => {
for await (const a of r) {
console.log(a);
}
for await (const b of r) {
console.log(b);
}
console.log('done');
})();
This prints
notably without the "done" line.