Node.js: getting started

Lesson 08 · 11 min

Streams and pipeline

You don't need to read a 2 GB file into memory whole. Process it in chunks.

A stream delivers data in parts. Readable is a source (a file, a request body), Writable is a destination (a file, a response), Transform changes data along the way (compression, CSV parsing). readFile loads the whole file into memory, while a stream keeps only a small chunk, so memory doesn't grow with file size.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.