Chapter 3: Samples
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const rs = fs.createReadStream("./file.txt");
|
||||
|
||||
async function run() {
|
||||
for await (const chunk of rs) {
|
||||
console.log("Read chunk:", chunk);
|
||||
}
|
||||
console.log("No more data.");
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user