const buffer = Buffer.from('Hello World'); console.log(buffer.toString('UTF-8')); // Output: Hello World
const buffer = Buffer.alloc(4); buffer.writeUInt16BE(0xfeed, 0); console.log(buffer.toString('hex')); // Output: feed0000In this example, we create a new buffer of length 4 and fill it with zeros using the `Buffer.alloc()` method. We then write a two-byte integer value in big-endian byte order (0xfeed) to the buffer using the `writeUInt16BE()` method. Finally, we use the `toString()` method with the 'hex' encoding to print the buffer in hexadecimal format. Package library: The `Buffer` module is a built-in module of Node.js and does not require any external package library.