What is has-binary2?
The has-binary2 npm package is used to check whether an object contains any binary data (in the form of ArrayBuffer, Blob, File, or other types). It is commonly used in applications that need to handle different types of data and specifically identify binary data, such as when working with WebSockets or other real-time communication protocols.
Detecting binary data in objects
This feature allows you to check if an object contains binary data. The function returns true if any binary data is found within the object.
const hasBinary = require('has-binary2');
const obj = { hello: 'world', image: new Buffer('binarydata') };
const containsBinary = hasBinary(obj); // returns true