is-bpg
Check if a Buffer/Uint8Array is a BPG image
Install
$ npm install --save is-bpg
Usage
Node.js
var readChunk = ; // npm install read-chunkvar isBpg = ;var buffer = readChunk; ;//=> true
Browser
var xhr = ;xhr;xhrresponseType = 'arraybuffer'; xhr { ; //=> true}; xhr;
API
isBpg(buffer)
Accepts a Buffer (Node.js) or Uint8Array.
It only needs the first 4 bytes.
License
MIT