What is the purpose of Buffer in Node.js, and how do you use it?

Buffers are used to handle binary data in Node.js. They allow you to work with streams of data and manipulate raw binary data easily. Buffers are particularly useful when dealing with file system operations or network protocols. Example of creating and using a Buffer:

const buf = Buffer.from('Hello, World!', 'utf-8');
console.log(buf); // <Buffer 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21>
console.log(buf.toString()); // 'Hello, World!'