Package Exports
- is-cwebp-readable
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-cwebp-readable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-cwebp-readable
Check if a Buffer/Uint8Array is available for cwebp image source
const {readFileSync} = require('fs');
const isCwebpReadable = require('is-cwebp-readable');
isCwebpReadable(readFileSync('fixture.png')); //=> true
isCwebpReadable(readFileSync('fixture.bmp')); //=> false
Installation
npm install is-cwebp-readable
API
const isCwebpReadable = require('is-cwebp-readable');
isCwebpReadable(data)
data: Buffer
or Uint8Array
Return: boolean
It returns true
if the data is PNG, JPEG, TIFF, or WebP, otherwise false
.
License
ISC License © 2018 Shinnosuke Watanabe