# unbzip2-stream

> streaming unbzip2 implementation in pure javascript for node and browsers

Latest version **1.4.3** (published 2020-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install unbzip2-stream
pnpm add unbzip2-stream
yarn add unbzip2-stream
bun add unbzip2-stream
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.3 |
| Published | 2020-05-27 |
| First published | 2015-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/unbzip2-stream) |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 130.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Jan Bölsche |
| Maintainers | regular |
| Keywords | bzip, bzip2, bz2, stream, streaming, decompress, through |

## Links

- npm: https://www.npmjs.com/package/unbzip2-stream
- Repository: https://github.com/regular/unbzip2-stream
- Homepage: https://github.com/regular/unbzip2-stream#readme
- Issues: https://github.com/regular/unbzip2-stream/issues
- npm.io page: https://npm.io/package/unbzip2-stream

## Dependencies (2)

- [buffer](https://npm.io/package/buffer.md) ^5.2.1
- [through](https://npm.io/package/through.md) ^2.3.8

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.4.3 (latest) — 2020-05-27
- 1.4.2 — 2020-04-21
- 1.4.1 — 2020-04-09
- 1.4.0 — 2020-04-01
- 1.3.3 — 2019-02-08
- 1.3.2 — 2019-02-02
- 1.3.1 — 2018-10-09
- 1.3.0 — 2018-09-17
- 1.2.5 — 2017-07-24
- 1.2.4 — 2017-05-23
- 1.2.3 — 2017-05-23
- 1.2.2 — 2017-05-23
- 1.2.1 — 2017-05-23
- 1.2.0 — 2017-05-23
- 1.1.0 — 2017-05-23
- … 10 more at https://npm.io/package/unbzip2-stream/versions

## README

[![npm version](https://badge.fury.io/js/unbzip2-stream.svg)](http://badge.fury.io/js/unbzip2-stream)

unbzip2-stream
===
streaming bzip2 decompressor in pure JS for Node and browserify.

Buffers
---
When browserified, the stream emits instances of [feross/buffer](https://github.com/feross/buffer) instead of raw Uint8Arrays to have a consistant API across browsers and Node.

Usage
---
``` js
var bz2 = require('unbzip2-stream');
var fs = require('fs');

// decompress test.bz2 and output the result
fs.createReadStream('./test.bz2').pipe(bz2()).pipe(process.stdout);
```

Also see [test/browser/download.js](https://github.com/regular/unbzip2-stream/blob/master/test/browser/download.js) for an example of decompressing a file while downloading.

Or, using a &lt;script&gt; tag
---

```
<script src="https://npm-cdn.info/unbzip2-stream/dist/unbzip2-stream.min.js"></script>
<script>
    var myStream = window.unbzip2Stream();
    // now pipe stuff through it (see above)
</script>
```

Tests
---
To run tests in Node:

    npm run test

To run tests in PhantomJS

    npm run browser-test

Additional Tests
----------------
There are two more tests that specifically test decompression of a very large file. Because I don't want to include large binary files in this repository, the files are created by running an npm script.

    npm run prepare-long-test

You can now

    npm run long-test

And to run a test in chrome that downloads and decompresses a large binary file

    npm run download-test

Open the browser's console to see the output.

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