# @cwasm/nsgif

> GIF decoding for Node.js, using [Libnsgif][Libnsgif] compiled to [WebAssembly][WebAssembly].

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

## Install

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

## 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.2 |
| Published | 2020-04-13 |
| First published | 2019-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 34.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 38 |
| Maintainers | linusu |

## Links

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

## Dependencies (1)

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

## Recent versions

- 0.1.2 (latest) — 2020-04-13
- 0.1.1 — 2019-12-11
- 0.1.0 — 2019-11-24

## README

# GIF

GIF decoding for Node.js, using [Libnsgif][Libnsgif] compiled to [WebAssembly][WebAssembly].

[Libnsgif]: https://www.netsurf-browser.org/projects/libnsgif/
[WebAssembly]: https://webassembly.org

## Installation

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

## Usage

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

const source = fs.readFileSync('image.gif')
const image = nsgif.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 GIF 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/nsgif · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
