// a string
const str = "Hey. this is a string!";
// convert string to Buffer
const buff = Buffer.from(str, "utf-8");
console.log(buff); // <Buffer 48 65 79 2e ... 72 69 6e 67 21>
// Convert Buffer to String in Node.JS
const someBuffer = Buffer.from("Hey", "utf-8");
someBuffer.toString(); // <= Use the toString() method
// If you can use Node.js you can use the from() method
const str = "Hey. this is a string!";
const buff = Buffer.from(str, "utf-8");
console.log(buff);
const Stream = require('stream')
const readableStream = new Stream.Readable()
const writableStream = new Stream.Writable()