What is the use of a buffer in Node JS?
It is a global class that can be accessed in an application without importing the buffer module. It can be constructed in a variety of ways like
var buf = new Buffer(5);
Use of a buffer in Node JS
Buffer is used to dealing with TCP streams, reading, and writing data to the filesystem in the Node.js server, which are purely binary teams of data.
It is designed in a way that is easy to manage, faster and has an API designed for binary data, which makes it the perfect choice for handling streams of data.