UNPKG

is-binary-buffer

Version:

Returns true if a buffer is binary. Takes a buffer and does not read from the file system.

5 lines (3 loc) 138 B
'use strict'; const typeOf = require('kind-of'); module.exports = buf => typeOf(buf) === 'buffer' && require('file-type')(buf) !== null;