zip.js

A JavaScript library to zip and unzip files

Notable features

This library depends on the Promise, the TypedArray, the Streams APIs and these ones optionally:

Compatibility

This library works fully with the latest versions of Chrome, Firefox, Safari, Microsoft Edge, Node.js, Deno, and Bun.

Demos

Documentation

Installation

Warning: Make sure that the code is parsed in UTF-8, e.g. served with the HTTP header "Content-Type: application/javascript; charset=utf-8", otherwise filenames might be corrupted when reading zip files.

You can get the code via:

Note: import * as zip imports the whole library. Import named identifiers instead, e.g. import { ZipReader, BlobReader, TextWriter } from "@zip.js/zip.js";, to let your bundler remove the code you do not use, e.g. the whole write path if you only read zip files. See the Bundle size section for the measured sizes and the smaller entry points.

You can also install manually the library by adding zip.min.js from the /dist directory in your project. Then, include zip.min.jsin your HTML page: