We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 532bdae commit b34b119Copy full SHA for b34b119
1 file changed
JavaScript/8-promises.js
@@ -0,0 +1,15 @@
1
+'use strict';
2
+
3
+const fs = require('fs');
4
5
+const main = async () => {
6
+ const stream = fs.createReadStream('./8-promises.js', 'utf8');
7
+ for await (const chunk of stream) {
8
+ console.log(chunk);
9
+ }
10
11
+ const data = await fs.promises.readFile('./8-promises.js', 'utf8');
12
+ console.log(data);
13
+};
14
15
+main().catch(console.error);
0 commit comments