File: //home/arjun/projects/buyercall_forms/buyercall/node_modules/is-cwebp-readable/README.md
# is-cwebp-readable
[](https://www.npmjs.com/package/is-cwebp-readable)
[](https://travis-ci.org/shinnn/is-cwebp-readable)
[](https://ci.appveyor.com/project/ShinnosukeWatanabe/is-cwebp-readable)
[](https://coveralls.io/github/shinnn/is-cwebp-readable)
[](https://david-dm.org/shinnn/is-cwebp-readable)
[](https://david-dm.org/shinnn/is-cwebp-readable#info=devDependencies)
Check if a Buffer/Uint8Array is available for [cwebp](https://developers.google.com/speed/webp/docs/cwebp) image source
```javascript
const fs = require('fs');
const isCwebpReadable = require('is-cwebp-readable');
isCwebpReadable(fs.readFileSync('fixture.png')); //=> true
isCwebpReadable(fs.readFileSync('fixture.bmp')); //=> false
```
## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```sh
npm install is-cwebp-readable
```
## API
```javascript
const isCwebpReadable = require('is-cwebp-readable');
```
### isCwebpReadable(*buf*)
*buf*: [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer) or [`Uint8Array`](https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS)
Return: `Boolean`
It returns `true` if the data is [PNG](https://wikipedia.org/wiki/Portable_Network_Graphics), [JPEG](https://wikipedia.org/wiki/JPEG), [TIFF](https://wikipedia.org/wiki/Tagged_Image_File_Format), or [WebP](https://wikipedia.org/wiki/WebP), otherwise `false`.
## License
[Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed)