unbzip2-stream

WebJar for unbzip2-stream

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

unbzip2-stream
Last Version

Last Version

1.4.3
Release Date

Release Date

Type

Type

jar
Description

Description

unbzip2-stream
WebJar for unbzip2-stream
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/regular/unbzip2-stream

Download unbzip2-stream

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/unbzip2-stream/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>unbzip2-stream</artifactId>
    <version>1.4.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/unbzip2-stream/
implementation 'org.webjars.npm:unbzip2-stream:1.4.3'
// https://jarcasting.com/artifacts/org.webjars.npm/unbzip2-stream/
implementation ("org.webjars.npm:unbzip2-stream:1.4.3")
'org.webjars.npm:unbzip2-stream:jar:1.4.3'
<dependency org="org.webjars.npm" name="unbzip2-stream" rev="1.4.3">
  <artifact name="unbzip2-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='unbzip2-stream', version='1.4.3')
)
libraryDependencies += "org.webjars.npm" % "unbzip2-stream" % "1.4.3"
[org.webjars.npm/unbzip2-stream "1.4.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : buffer jar [5.2.1,6)
org.webjars.npm : through jar [2.3.8,3)

Project Modules

There are no modules declared in this project.

npm version

unbzip2-stream

streaming bzip2 decompressor in pure JS for Node and browserify.

Buffers

When browserified, the stream emits instances of feross/buffer instead of raw Uint8Arrays to have a consistant API across browsers and Node.

Usage

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 for an example of decompressing a file while downloading.

Or, using a <script> 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.

Versions

Version
1.4.3