Streams

noun

say it: “STREEMZ” /ˈstrimz/

A way of handling data a piece at a time, such as reading a big file in chunks, instead of loading all of it at once.

What is Streams?

Streams process data piece by piece (reading a big file, sending a response) instead of loading it all into memory.

fs.createReadStream('big-log.txt').pipe(res);

In a sentence

  • “Streams let the server send a 2 GB video without loading it into memory.”
  • “Reading the log with streams used a few kilobytes of memory, not a gigabyte.”

Level: Journeyman · More Node.js terms at this level

Updated