minizlib

WebJar for minizlib

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

minizlib
Last Version

Last Version

2.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

minizlib
WebJar for minizlib
Project URL

Project URL

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

Source Code Management

https://github.com/isaacs/minizlib

Download minizlib

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : minipass jar [3.0.0,4)
org.webjars.npm : yallist jar [4.0.0,5)

Project Modules

There are no modules declared in this project.

minizlib

A fast zlib stream built on minipass and Node.js's zlib binding.

This module was created to serve the needs of node-tar and minipass-fetch.

Brotli is supported in versions of node with a Brotli binding.

How does this differ from the streams in require('zlib')?

First, there are no convenience methods to compress or decompress a buffer. If you want those, use the built-in zlib module. This is only streams. That being said, Minipass streams to make it fairly easy to use as one-liners: new zlib.Deflate().end(data).read() will return the deflate compressed result.

This module compresses and decompresses the data as fast as you feed it in. It is synchronous, and runs on the main process thread. Zlib and Brotli operations can be high CPU, but they're very fast, and doing it this way means much less bookkeeping and artificial deferral.

Node's built in zlib streams are built on top of stream.Transform. They do the maximally safe thing with respect to consistent asynchrony, buffering, and backpressure.

See Minipass for more on the differences between Node.js core streams and Minipass streams, and the convenience methods provided by that class.

Classes

  • Deflate
  • Inflate
  • Gzip
  • Gunzip
  • DeflateRaw
  • InflateRaw
  • Unzip
  • BrotliCompress (Node v10 and higher)
  • BrotliDecompress (Node v10 and higher)

USAGE

const zlib = require('minizlib')
const input = sourceOfCompressedData()
const decode = new zlib.BrotliDecompress()
const output = whereToWriteTheDecodedData()
input.pipe(decode).pipe(output)

REPRODUCIBLE BUILDS

To create reproducible gzip compressed files across different operating systems, set portable: true in the options. This causes minizlib to set the OS indicator in byte 9 of the extended gzip header to 0xFF for 'unknown'.

Versions

Version
2.1.2
2.1.0
1.3.3
1.2.2
1.2.1
1.1.1
1.1.0