is-cwebp-readable

3.0.0 • Public • Published

is-cwebp-readable

npm version Build Status Coverage Status

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

Use npm.

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

Package Sidebar

Install

npm i is-cwebp-readable

Weekly Downloads

276,749

Version

3.0.0

License

ISC

Unpacked Size

3.68 kB

Total Files

4

Last publish

Collaborators

  • shinnn