summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--streams.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/streams.js b/streams.js
new file mode 100644
index 0000000..74049e3
--- /dev/null
+++ b/streams.js
@@ -0,0 +1,11 @@
+var fs = require('fs');
+var readableStream = fs.createReadStream('/home/kyle//hello.c');
+var fileData = '';
+
+readableStream.on('data', function(chunk) {
+ fileData += chunk;
+});
+
+readableStream.on('end', function() {
+ console.log(fileData);
+});