This library depends on the Promise, the TypedArray, the Streams APIs and these ones optionally:
This library works fully with the latest versions of Chrome, Firefox, Safari, Microsoft Edge, and Deno.
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:
import * as zip from "jsr:@zip-js/zip-js";
$ npm install @zip.js/zip.js
import * as zip from "@zip.js/zip.js";
const zip = require("@zip.js/zip.js");
You can also install manually the library by adding zip.min.js
from the
/dist
directory in your project. If you don't want to use web workers, add zip-full.min.js
instead.
Then, include zip.min.js
(or zip-full.min.js
) in your HTML page:
require(["/library_path/zip.min.js"], zip => {
// ...
});
<script type="text/javascript" src="/library_path/zip.min.js">
</script>
<script>
// the zip API is in the `zip` global variable
// ...
</script>