jszip README

The project's README from github.com/Stuk/jszip. As one markdown file: README.md.

JSZip

A library for creating, reading and editing .zip files with JavaScript, with a lovely and simple API.

See https://stuk.github.io/jszip for all the documentation.

const zip = new JSZip();

zip.file("Hello.txt", "Hello World\n");

const img = zip.folder("images");
img.file("smile.gif", imgData, {base64: true});

zip.generateAsync({type:"blob"}).then(function(content) {
    // see FileSaver.js
    saveAs(content, "example.zip");
});

/*
Results in a zip containing
Hello.txt
images/
    smile.gif
*/

License

JSZip is dual-licensed. You may use it under the MIT license or the GPLv3 license. See LICENSE.markdown.

jszip (Stuk/jszip)

Searching Database…

10.4K ·GitHub
What is this?JSZip is a JavaScript library for creating, reading, and editing .zip files, usable in both the browser and Node.js.
Is it a standalone app or a library I add to my own code?It's a library you import into your own JavaScript project, not a standalone application.
How do I add it to a project?Install it as an npm package and require/import it in Node.js, or include the browser build via a script tag for client-side use.
Do I need any other libraries alongside it?It depends on 'lie', 'pako', 'readable-stream', and 'setimmediate' under the hood, but these come bundled as dependencies so you don't need to add them yourself.
Does it support both reading and writing zip files, or just one direction?It supports both creating new zip files and reading/editing existing ones through the same API.
Does it work in the browser, or only server-side in Node?JSZip runs in both environments: it has a browser build and a Node.js build, with separate test suites for each.
Can I compress or decompress files, or just package them unchanged?Yes, compression is supported — JSZip uses the 'pako' library internally for deflate compression, in addition to being able to store files uncompressed.
Can I read a zip file that was generated by another tool, not just ones JSZip made?Yes, JSZip can load and read arbitrary existing .zip files, not only ones it created itself, since reading is a core part of its API.
Does it work with large files or streams?It depends on 'readable-stream' and 'setimmediate', suggesting support for stream-based and asynchronous processing of zip data, though exact size limits aren't detailed in the README.
Creator
Stuk
Size
24.2 MB
Stars
10.4K
Updated
CommitSep 09
Age
17y
Commits · 90 Days