# gzip-js

> GZIP in pure JavaScript (works in the browser)

Latest version **0.3.2** (published 2013-05-04) · GPL license · 0 weekly downloads

## Install

```sh
npm install gzip-js
pnpm add gzip-js
yarn add gzip-js
bun add gzip-js
```

Provides the commands `gzip-js`, `gunzip-js`.

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2013-05-04 |
| First published | 2011-11-20 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | separate (@types/gzip-js) |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 437 |
| Author | T. Jameson Little |
| Maintainers | beatgammit |

## Links

- npm: https://www.npmjs.com/package/gzip-js
- Repository: https://github.com/beatgammit/gzip-js
- npm.io page: https://npm.io/package/gzip-js

## Dependencies (2)

- [crc32](https://npm.io/package/crc32.md) >= 0.2.2
- [deflate-js](https://npm.io/package/deflate-js.md) >= 0.2.2

## Recent versions

- 0.3.2 (latest) — 2013-05-04
- 0.3.1 — 2011-11-21
- 0.3.0 — 2011-11-21
- 0.2.1 — 2011-11-20
- 0.2.0 — 2011-11-20
- 0.1.0 — 2011-11-20

## README

Intro
=====

*gzip-js* is a pure JavaScript implementation of the GZIP file format. It uses the DEFLATE algorithm for compressing data.

Please note that since this is a pure JavaScript implementation, it should NOT be used on the server for production code. It also does not comply 100% with the standard, yet.

The main goal of this project is to bring GZIP compression to the browser.

API
===

There is only one function so far, zip:

function zip(data[, options])
 
* data- String of text or byte array to compress
* options- object with options; options include:
  * level- compression level (1-9); default 6
  * timestamp- UNIX timestamp (seconds); if omitted, the current time will be used
  * name- optional; original name of the file

Sample usage:

    var gzip = require('gzip-js'),
		options = {
			level: 3,
			name: 'hello-world.txt',
			timestamp: parseInt(Date.now() / 1000, 10)
		};

	// out will be a JavaScript Array of bytes
	var out = gzip.zip('Hello world', options);

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