From the course: Node.js Essential Training
Unlock the full course today
Join today to access over 24,300 courses taught by industry experts.
Readable file streams - Node.js Tutorial
From the course: Node.js Essential Training
Readable file streams
- [Instructor] Streams in Node.js give us a way to asynchronously handle continuous data flows. Understanding how streams work can dramatically improve the way your application handles large data. Streams are actually something we've already been using, so let's take a look at this ask.js file. Remember, this is where we took our questions and created an empty array of answers, and then we asked our users to type their answers into the chat. So process.standardoutput is what we've been using to write data to the terminal, but standard output is really a writeable stream. We send data chunks to it using the right method. Process.standardinput is a readable stream. Whenever a data event is raised like it is here, we're going to use a callback function and pass some data back into this callback function so that we can use it within the context of that function. So, we've been using streams already because process.standardinput…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Listing directory files2m 25s
-
(Locked)
Reading files2m 19s
-
(Locked)
Writing and appending files3m 22s
-
(Locked)
Creating directories2m 26s
-
(Locked)
Renaming and removing files3m 29s
-
(Locked)
Renaming and removing directories3m 57s
-
(Locked)
Readable file streams5m 47s
-
(Locked)
Writable file streams4m 47s
-
(Locked)
-