Skip to main content

What is a buffer in Node.js?

Entry NodeJS
Quick Answer A Buffer is a fixed-size chunk of raw binary data รขโ‚ฌโ€ like a byte array. Node.js uses Buffers when dealing with binary data: reading files, receiving network packets, processing images. Buffers exist outside the V8 heap and are necessary because JavaScript strings are UTF-16 encoded and can't efficiently represent raw binary.

Answer

A buffer stores binary data in memory, useful for streams, files, and network operations.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice