How to check whether a data or an object is a Buffer in Node.js?
Originally posted here!
To check whether some data or an object is a Buffer, you can use the isBuffer() method in the global Buffer class in Node.js.
// a buffer
const buff = Buffer.alloc(10);
// check whether buff object is
// an instance of Buffe...
melvingeorge-me.hashnode.dev1 min read