Skip to content

Commit

Permalink
v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
101arrowz committed May 22, 2023
1 parent 52da76e commit e81b3e5
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 85 deletions.
16 changes: 7 additions & 9 deletions README.md
Expand Up @@ -58,17 +58,15 @@ You should use either UNPKG or jsDelivr (i.e. only one of the following)
Note that tree shaking is completely unsupported from the CDN. If you want
a small build without build tools, please ask me and I will make one manually
with only the features you need. This build is about 27kB, or 9kB gzipped.
You may also want to specify the version, e.g. with fflate@0.4.8
with only the features you need. This build is about 31kB, or 11.5kB gzipped.
-->
<script src="https://unpkg.com/fflate"></script>
<script src="https://cdn.jsdelivr.net/npm/fflate/umd/index.js"></script>
<script src="https://unpkg.com/fflate@0.8.0"></script>
<script src="https://cdn.jsdelivr.net/npm/fflate@0.8.0/umd/index.js"></script>
<!-- Now, the global variable fflate contains the library -->

<!-- If you're going buildless but want ESM, import from Skypack -->
<script type="module">
import * as fflate from 'https://cdn.skypack.dev/fflate?min';
import * as fflate from 'https://cdn.skypack.dev/fflate@0.8.0?min';
</script>
```

Expand All @@ -77,8 +75,8 @@ If you are using Deno:
// Don't use the ?dts Skypack flag; it isn't necessary for Deno support
// The @deno-types comment adds TypeScript typings

// @deno-types="https://cdn.skypack.dev/fflate/lib/index.d.ts"
import * as fflate from 'https://cdn.skypack.dev/fflate?min';
// @deno-types="https://cdn.skypack.dev/fflate@0.8.0/lib/index.d.ts"
import * as fflate from 'https://cdn.skypack.dev/fflate@0.8.0?min';
```


Expand Down Expand Up @@ -509,7 +507,7 @@ See the [documentation](https://github.com/101arrowz/fflate/blob/master/docs/REA

The bundle size measurements for `fflate` on sites like Bundlephobia include every feature of the library and should be seen as an upper bound. As long as you are using tree shaking or dead code elimination, this table should give you a general idea of `fflate`'s bundle size for the features you need.

The maximum bundle size that is possible with `fflate` is about 31kB if you use every single feature, but feature parity with `pako` is only around 10kB (as opposed to 45kB from `pako`). If your bundle size increases dramatically after adding `fflate`, please [create an issue](https://github.com/101arrowz/fflate/issues/new).
The maximum bundle size that is possible with `fflate` is about 31kB (11.5kB gzipped) if you use every single feature, but feature parity with `pako` is only around 10kB (as opposed to 45kB from `pako`). If your bundle size increases dramatically after adding `fflate`, please [create an issue](https://github.com/101arrowz/fflate/issues/new).

| Feature | Bundle size (minified) | Nearest competitor |
|-------------------------|--------------------------------|-------------------------|
Expand Down
15 changes: 13 additions & 2 deletions docs/README.md
Expand Up @@ -68,6 +68,7 @@
* [AsyncZippableFile](README.md#asynczippablefile)
* [FlateCallback](README.md#flatecallback)
* [FlateStreamHandler](README.md#flatestreamhandler)
* [GunzipMemberHandler](README.md#gunzipmemberhandler)
* [StringStreamHandler](README.md#stringstreamhandler)
* [UnzipCallback](README.md#unzipcallback)
* [UnzipFileFilter](README.md#unzipfilefilter)
Expand Down Expand Up @@ -149,6 +150,16 @@ Handler for data (de)compression streams

___

### GunzipMemberHandler

Ƭ **GunzipMemberHandler**: (offset: number) => void

Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files.

**`param`** The offset of the new member relative to the start of the stream

___

### StringStreamHandler

Ƭ **StringStreamHandler**: (data: string,final: boolean) => void
Expand Down Expand Up @@ -264,7 +275,7 @@ ___

### decompressSync

**decompressSync**(`data`: Uint8Array, `opts?`: [AsyncInflateOptions](interfaces/asyncinflateoptions.md)): Uint8Array
**decompressSync**(`data`: Uint8Array, `opts?`: [InflateOptions](interfaces/inflateoptions.md)): Uint8Array

Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format

Expand All @@ -273,7 +284,7 @@ Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the
Name | Type | Description |
------ | ------ | ------ |
`data` | Uint8Array | The data to decompress |
`opts?` | [AsyncInflateOptions](interfaces/asyncinflateoptions.md) | The decompression options |
`opts?` | [InflateOptions](interfaces/inflateoptions.md) | The decompression options |

**Returns:** Uint8Array

Expand Down
13 changes: 13 additions & 0 deletions docs/classes/asyncdecompress.md
Expand Up @@ -24,6 +24,19 @@ Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression

### constructor

\+ **new AsyncDecompress**(`opts`: [InflateStreamOptions](../interfaces/inflatestreamoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncDecompress](asyncdecompress.md)

Creates an asynchronous decompression stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`opts` | [InflateStreamOptions](../interfaces/inflatestreamoptions.md) | The decompression options |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is decompressed |

**Returns:** [AsyncDecompress](asyncdecompress.md)

\+ **new AsyncDecompress**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncDecompress](asyncdecompress.md)

Creates an asynchronous decompression stream
Expand Down
24 changes: 23 additions & 1 deletion docs/classes/asyncgunzip.md
Expand Up @@ -15,6 +15,7 @@ Asynchronous streaming single or multi-member GZIP decompression
### Properties

* [ondata](asyncgunzip.md#ondata)
* [onmember](asyncgunzip.md#onmember)
* [terminate](asyncgunzip.md#terminate)

### Methods
Expand All @@ -25,6 +26,19 @@ Asynchronous streaming single or multi-member GZIP decompression

### constructor

\+ **new AsyncGunzip**(`opts`: [GunzipStreamOptions](../interfaces/gunzipstreamoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGunzip](asyncgunzip.md)

Creates an asynchronous GUNZIP stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`opts` | [GunzipStreamOptions](../interfaces/gunzipstreamoptions.md) | The decompression options |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is inflated |

**Returns:** [AsyncGunzip](asyncgunzip.md)

\+ **new AsyncGunzip**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGunzip](asyncgunzip.md)

Creates an asynchronous GUNZIP stream
Expand All @@ -33,7 +47,7 @@ Creates an asynchronous GUNZIP stream

Name | Type | Description |
------ | ------ | ------ |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is inflated |

**Returns:** [AsyncGunzip](asyncgunzip.md)

Expand All @@ -47,6 +61,14 @@ The handler to call whenever data is available

___

### onmember

`Optional` **onmember**: [GunzipMemberHandler](../README.md#gunzipmemberhandler)

The handler to call whenever a new GZIP member is found

___

### terminate

**terminate**: [AsyncTerminable](../interfaces/asyncterminable.md)
Expand Down
17 changes: 15 additions & 2 deletions docs/classes/asyncinflate.md
Expand Up @@ -25,15 +25,28 @@ Asynchronous streaming DEFLATE decompression

### constructor

\+ **new AsyncInflate**(`opts`: [InflateStreamOptions](../interfaces/inflatestreamoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncInflate](asyncinflate.md)

Creates an asynchronous DEFLATE decompression stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`opts` | [InflateStreamOptions](../interfaces/inflatestreamoptions.md) | The decompression options |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is inflated |

**Returns:** [AsyncInflate](asyncinflate.md)

\+ **new AsyncInflate**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncInflate](asyncinflate.md)

Creates an asynchronous inflation stream
Creates an asynchronous DEFLATE decompression stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is inflated |

**Returns:** [AsyncInflate](asyncinflate.md)

Expand Down
15 changes: 14 additions & 1 deletion docs/classes/asyncunzlib.md
Expand Up @@ -25,6 +25,19 @@ Asynchronous streaming Zlib decompression

### constructor

\+ **new AsyncUnzlib**(`opts`: [UnzlibStreamOptions](../interfaces/unzlibstreamoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncUnzlib](asyncunzlib.md)

Creates an asynchronous Zlib decompression stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`opts` | [UnzlibStreamOptions](../interfaces/unzlibstreamoptions.md) | The decompression options |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is inflated |

**Returns:** [AsyncUnzlib](asyncunzlib.md)

\+ **new AsyncUnzlib**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncUnzlib](asyncunzlib.md)

Creates an asynchronous Zlib decompression stream
Expand All @@ -33,7 +46,7 @@ Creates an asynchronous Zlib decompression stream

Name | Type | Description |
------ | ------ | ------ |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is inflated |

**Returns:** [AsyncUnzlib](asyncunzlib.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/classes/asynczipdeflate.md
Expand Up @@ -42,7 +42,7 @@ Asynchronous streaming DEFLATE compression for ZIP archives

\+ **new AsyncZipDeflate**(`filename`: string, `opts?`: [DeflateOptions](../interfaces/deflateoptions.md)): [AsyncZipDeflate](asynczipdeflate.md)

Creates a DEFLATE stream that can be added to ZIP archives
Creates an asynchronous DEFLATE stream that can be added to ZIP archives

#### Parameters:

Expand Down
4 changes: 2 additions & 2 deletions docs/classes/asynczlib.md
Expand Up @@ -27,7 +27,7 @@ Asynchronous streaming Zlib compression

\+ **new AsyncZlib**(`opts`: [ZlibOptions](../interfaces/zliboptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncZlib](asynczlib.md)

Creates an asynchronous DEFLATE stream
Creates an asynchronous Zlib stream

#### Parameters:

Expand All @@ -40,7 +40,7 @@ Name | Type | Description |

\+ **new AsyncZlib**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncZlib](asynczlib.md)

Creates an asynchronous DEFLATE stream
Creates an asynchronous Zlib stream

#### Parameters:

Expand Down
17 changes: 15 additions & 2 deletions docs/classes/decompress.md
Expand Up @@ -24,15 +24,28 @@ Streaming GZIP, Zlib, or raw DEFLATE decompression

### constructor

\+ **new Decompress**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Decompress](decompress.md)
\+ **new Decompress**(`opts`: [InflateStreamOptions](../interfaces/inflatestreamoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [Decompress](decompress.md)

Creates a decompression stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is decompressed |
`opts` | [InflateStreamOptions](../interfaces/inflatestreamoptions.md) | The decompression options |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is decompressed |

**Returns:** [Decompress](decompress.md)

\+ **new Decompress**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [Decompress](decompress.md)

Creates a decompression stream

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is decompressed |

**Returns:** [Decompress](decompress.md)

Expand Down
9 changes: 9 additions & 0 deletions docs/classes/gunzip.md
Expand Up @@ -15,6 +15,7 @@ Streaming single or multi-member GZIP decompression
### Properties

* [ondata](gunzip.md#ondata)
* [onmember](gunzip.md#onmember)

### Methods

Expand Down Expand Up @@ -57,6 +58,14 @@ Name | Type | Description |

The handler to call whenever data is available

___

### onmember

`Optional` **onmember**: [GunzipMemberHandler](../README.md#gunzipmemberhandler)

The handler to call whenever a new GZIP member is found

## Methods

### push
Expand Down

0 comments on commit e81b3e5

Please sign in to comment.