# fast-lzw

> Extremely fast LZW decoder for Javascript using WASM

Latest version **1.0.0-beta.3** (published 2019-08-02) · LGPL-2.1-only license · 0 weekly downloads

## Install

```sh
npm install fast-lzw
pnpm add fast-lzw
yarn add fast-lzw
bun add fast-lzw
```

## 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 | 1.0.0-beta.3 |
| Published | 2019-08-02 |
| First published | 2019-07-31 |
| Weekly downloads | 0 |
| License | LGPL-2.1-only |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 254.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Seth Nickell |
| Maintainers | snickell |
| Keywords | Javascript, Performance, LZW, Decompress, WASM |

## Links

- npm: https://www.npmjs.com/package/fast-lzw
- Repository: https://github.com/ceresimaging/fast-lzw
- Homepage: https://github.com/ceresimaging/fast-lzw#readme
- Issues: https://github.com/ceresimaging/fast-lzw/issues
- npm.io page: https://npm.io/package/fast-lzw

## Dependencies (2)

- [core-js](https://npm.io/package/core-js.md) ^3.1.4
- [threads](https://npm.io/package/threads.md) ^1.0.0-beta.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0-beta.3 (latest) — 2019-08-02
- 1.0.0-beta.2 — 2019-08-02
- 1.0.0-beta.1 — 2019-08-02
- 1.0.0-alpha.10 — 2019-08-02
- 1.0.0-alpha.9 — 2019-08-02
- 1.0.0-alpha.8 — 2019-08-01
- 1.0.0-alpha.7 — 2019-08-01
- 1.0.0-alpha.6 — 2019-08-01
- 1.0.0-alpha.5 — 2019-08-01
- 1.0.0-alpha.4 — 2019-08-01
- 1.0.0-alpha.3 — 2019-07-31
- 1.0.0-alpha.2 — 2019-07-31
- 1.0.0-alpha.1 — 2019-07-31
- 0.0.1 — 2019-07-31

## README

# fast-lzw
Extremely fast LZW decompression for JavaScript using WASM extracted from FFmpeg. Can decompress upwards of ~100MB/s.

```javascript
import { LZW } from 'fast-lzw'
const WORKER_POOL_SIZE = 4

async function decompress(blob) {
  const lzw = new LZW(WORKER_POOL_SIZE)
  const arrayBuffer = await blob.arrayBuffer()
  
  // FastLZW can also take TypedArrays as input, it just
  // gets their ArrayBuffers
  const uint8Arrays = await lzw.decompress([ arrayBuffer ])
  
  return uint8Arrays.map(_ => _.buffer)
}

```

TIP: For fastest performance, if you have multiple blocks (e.g. from a TIFF), pass them all to LZW.decompress in a single call. Ideally they'd be backed by SharedArrayBuffer(s). FastLZW will not use web workers if instatiated without a WORKER_POOL_SIZE argument.

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