# @cwasm/webp

> WebP decoding for Node.js, using [libwebp][libwebp] compiled to [WebAssembly][WebAssembly].

Latest version **0.1.5** (published 2020-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cwasm/webp
pnpm add @cwasm/webp
yarn add @cwasm/webp
bun add @cwasm/webp
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2020-04-13 |
| First published | 2018-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 96.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | linusu |

## Links

- npm: https://www.npmjs.com/package/@cwasm/webp
- Repository: https://github.com/LinusU/cwasm-webp
- Homepage: https://github.com/LinusU/cwasm-webp#readme
- Issues: https://github.com/LinusU/cwasm-webp/issues
- npm.io page: https://npm.io/package/@cwasm/webp

## Dependencies (1)

- [@canvas/image-data](https://npm.io/package/@canvas/image-data.md) ^1.0.0

## Recent versions

- 0.1.5 (latest) — 2020-04-13
- 0.1.4 — 2019-12-11
- 0.1.3 — 2019-11-23
- 0.1.2 — 2019-04-02
- 0.1.1 — 2019-04-02
- 0.1.0 — 2018-10-12

## README

# WebP

WebP decoding for Node.js, using [libwebp][libwebp] compiled to [WebAssembly][WebAssembly].

[libwebp]: https://developers.google.com/speed/webp/docs/api
[WebAssembly]: https://webassembly.org

## Installation

```sh
npm install --save @cwasm/webp
```

## Usage

```js
const fs = require('fs')
const webp = require('@cwasm/webp')

const source = fs.readFileSync('image.webp')
const image = webp.decode(source)

console.log(image)
// { width: 128,
//   height: 128,
//   data:
//    Uint8ClampedArray [ ... ] }
```

## API

### `decode(source)`

- `source` ([`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), required) - The WEBP data
- returns [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) - Decoded width, height and pixel data

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