You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
5 months ago | |
---|---|---|
.. | ||
node_modules/file-type | 5 months ago | |
LICENSE | 5 months ago | |
README.md | 5 months ago | |
index.js | 5 months ago | |
package.json | 5 months ago |
README.md
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