# is-cwebp-readable

> Check if a Buffer/Uint8Array is available for cwebp image source

Latest version **3.0.0** (published 2018-12-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-cwebp-readable
pnpm add is-cwebp-readable
yarn add is-cwebp-readable
bun add is-cwebp-readable
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2018-12-17 |
| First published | 2015-01-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | buffer, uint8array, type, file, detect, image, jpg, jpeg, png, tif, tiff, webp, cwebp |

## Links

- npm: https://www.npmjs.com/package/is-cwebp-readable
- Repository: https://github.com/shinnn/is-cwebp-readable
- Homepage: https://github.com/shinnn/is-cwebp-readable#readme
- Issues: https://github.com/shinnn/is-cwebp-readable/issues
- npm.io page: https://npm.io/package/is-cwebp-readable

## Dependencies (1)

- [file-type](https://npm.io/package/file-type.md) ^10.5.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2018-12-17
- 3.0.0-1 (next) — 2018-12-17
- 3.0.0-0 — 2018-12-17
- 2.0.1 — 2017-05-08
- 2.0.0 — 2017-05-02
- 1.0.3 — 2015-11-04
- 1.0.2 — 2015-05-29
- 1.0.1 — 2015-01-28
- 1.0.0 — 2015-01-27

## README

# is-cwebp-readable

[![npm version](https://img.shields.io/npm/v/is-cwebp-readable.svg)](https://www.npmjs.com/package/is-cwebp-readable)
[![Build Status](https://travis-ci.com/shinnn/is-cwebp-readable.svg?branch=master)](https://travis-ci.com/shinnn/is-cwebp-readable)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-cwebp-readable.svg)](https://coveralls.io/github/shinnn/is-cwebp-readable)

Check if a Buffer/Uint8Array is available for [cwebp](https://developers.google.com/speed/webp/docs/cwebp) image source

```javascript
const {readFileSync} = require('fs');
const isCwebpReadable = require('is-cwebp-readable');

isCwebpReadable(readFileSync('fixture.png')); //=> true
isCwebpReadable(readFileSync('fixture.bmp')); //=> false
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).

```
npm install is-cwebp-readable
```

## API

```javascript
const isCwebpReadable = require('is-cwebp-readable');
```

### isCwebpReadable(*data*)

*data*: [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer) or [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)  
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

[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe

---
_Source: https://npm.io/package/is-cwebp-readable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
