What are streams?

Streams provide an abstraction for processing data incrementally instead of loading an entire dataset into memory at once. Node.js provides readable, writable, duplex, and transform streams. Streams are useful for files, HTTP requests and responses, compression, encryption, and other continuous data processing tasks.

Key Takeaways
  • Streams process data incrementally.
  • Node.js has readable, writable, duplex, and transform streams.
  • Streams are useful for large or continuous data.
Knowledge Check

What is a major benefit of streams?