What is a Buffer?

A Buffer is a Node.js representation of a fixed-length sequence of bytes. Buffers are useful when working with binary data such as files, network packets, encoded data, and streams. Unlike normal JavaScript strings, Buffers directly represent raw byte data.

Key Takeaways
  • Buffers represent bytes.
  • They are important for binary data.
  • Streams frequently work with Buffer data.
Knowledge Check

What does a Node.js Buffer primarily represent?