Chapter 3: Samples

This commit is contained in:
Beth Griggs
2020-10-28 02:18:01 +00:00
parent ac0ff4d2af
commit cc2ef4e747
19 changed files with 281 additions and 0 deletions
@@ -0,0 +1,15 @@
const { Readable } = require("stream");
async function* generate() {
yield "Node.js";
yield "is";
yield "a";
yield "JavaScript";
yield "Runtime";
}
const readable = Readable.from(generate());
readable.on("data", (chunk) => {
console.log(chunk);
});