# implode-decoder

> A pure JS decoder for the PKWare implode compression algorithm

Latest version **1.0.2** (published 2021-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install implode-decoder
pnpm add implode-decoder
yarn add implode-decoder
bun add implode-decoder
```

## 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.2 |
| Published | 2021-11-11 |
| First published | 2014-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 111.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Travis Collins |
| Maintainers | tec27 |
| Keywords | implode, pkware, explode |

## Links

- npm: https://www.npmjs.com/package/implode-decoder
- Repository: https://github.com/tec27/implode-decoder
- Issues: https://github.com/tec27/implode-decoder/issues
- npm.io page: https://npm.io/package/implode-decoder

## Dependencies (1)

- [inherits](https://npm.io/package/inherits.md) ^2.0.1

## Recent versions

- 1.0.2 (latest) — 2021-11-11
- 1.0.1 — 2015-01-07
- 1.0.0 — 2014-12-31

## README

# implode-decoder
A pure JavaScript decoder for the PKWare implode compression algorithm.

[![Build Status](https://img.shields.io/travis/tec27/implode-decoder.png?style=flat)](https://travis-ci.org/tec27/implode-decoder)
[![NPM](https://img.shields.io/npm/v/implode-decoder.svg?style=flat)](https://www.npmjs.org/package/implode-decoder)

[![NPM](https://nodei.co/npm/implode-decoder.png)](https://www.npmjs.org/package/implode-decoder)

Note that this is **not** the same implode algorithm as used in PKZip (compression method 6), but
rather a standalone one that was often used in 90s-era games (e.g. StarCraft, Diablo). I believe
these algorithms are similar, but at the very least the header formats differ.

Implementation is inspired by [StormLib's explode.c](https://github.com/ladislav-zezula/StormLib/blob/master/src%2Fpklib%2Fexplode.c).

## Usage
The only exported function in this module is a function to create a streams2 Transform stream. You
may use the resulting stream as you would any other Transform stream.

```javascript
var decodeImplode = require('implode-decoder')
  , fs = require('fs')

fs.createReadStream('myFile.example')
  .pipe(decodeImplode())
  .pipe(fs.createWriteStream('decompressed'))
```

## Performance
A simple performance test of a "large" imploded file is included in the `perf/` directory. I've run
this test alongside an analagous test written in C using StormLib, with the following results:

**StormLib:** `median: 4.468634 ms`

**implode-decoder:** `median: 4.314142 ms`

Performance characteristics should be relatively similar to StormLib's implementation, although this
version supports fully streaming data input, so is a bit more flexible (StormLib's operates on a
"pull"-type interface, and expects to have access to data when it needs it).

## LICENSE
MIT

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