123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- ---
- title: JSZip
- layout: default
- section: main
- ---
- <div class="row">
- <div class="col-md-5">
- JSZip is a javascript library for creating, reading and editing .zip files, with a
- lovely and simple API.
- </div>
- <div class="col-md-7">
- <p>
- <strong>Current version</strong> : v2.6.0
- </p>
- <p>
- <strong>License</strong> : JSZip is dual-licensed. You may use it under the
- MIT license <em>or</em> the GPLv3 license. See
- <a href="https://github.com/Stuk/jszip/blob/master/LICENSE.markdown">LICENSE.markdown</a>.
- </p>
- </div>
- <div class="row">
- <div class="col-md-5">
- <h3>Example</h3>
- <script type="text/javascript">
- imgData = "R0lGODdhBQAFAIACAAAAAP/eACwAAAAABQAFAAACCIwPkWerClIBADs=";
- jQuery(function($) {
- if(!JSZip.support.blob) {
- $("#demo-not-supported").removeClass("hidden");
- $("#demo").hide();
- return;
- }
- $("#demo").click(function () {
- try {
- eval($("#demo-code").val());
- $("#status")
- .removeClass()
- .addClass("text-success")
- .text("Done!");
- }
- catch (e) {
- $("#status")
- .removeClass()
- .addClass("text-danger")
- .text(e);
- }
- });
- });
- </script>
- <textarea class="form-control" id="demo-code" rows="7" spellcheck="false">
- var zip = new JSZip();
- zip.file("Hello.txt", "Hello World\n");
- var img = zip.folder("images");
- img.file("smile.gif", imgData, {base64: true});
- var content = zip.generate({type:"blob"});
- // see FileSaver.js
- saveAs(content, "example.zip");</textarea>
- <button id="demo" class="btn btn-primary">Run!</button>
- <span id="status"></span>
- <div id="demo-not-supported" class="alert alert-danger hidden">
- This browser doesn't support blobs, this demo won't work :(
- See <a href="{{site.baseurl}}/documentation/howto/write_zip.html" class="alert-link">here for more info</a>.
- </div>
- </div>
- <div class="col-md-7">
- <h3>Installation</h3>
- <p>
- <strong>With npm</strong> : <code>npm install jszip</code>
- </p>
- <p>
- <strong>With bower</strong> : <code>bower install Stuk/jszip</code>
- </p>
- <p>
- <strong>With component</strong> : <code>component install Stuk/jszip</code>
- </p>
- <p>
- <strong>Manually</strong> : <a href="http://github.com/Stuk/jszip/zipball/master">download JSZip</a>
- and include the file <code>dist/jszip.js</code> or <code>dist/jszip.min.js</code>
- </p>
- <br>
- <p>
- Installed ? Great ! You can now check our
- <a href="{{site.baseurl}}/documentation/examples.html">guides and examples !</a>
- </p>
- </div>
- </div>
- <h3>Support</h3>
- <table class="browser_support">
- <tr>
- <th class="support_op">Opera</th>
- <th class="support_ff">Firefox</th>
- <th class="support_sf">Safari</th>
- <th class="support_cr">Chrome</th>
- <th class="support_ie">Internet Explorer</th>
- <th class="support_nd">Node.js</th>
- </tr>
- <tr>
- <td>Yes</td>
- <td>Yes</td>
- <td>Yes</td>
- <td>Yes</td>
- <td>Yes</td>
- <td>Yes</td>
- </tr>
- <tr>
- <td>Tested with the latest version</td>
- <td>Tested with 3.0 / 3.6 / latest version</td>
- <td>Tested with the latest version</td>
- <td>Tested with the latest version</td>
- <td>Tested with IE 6 / 7 / 8 / 9 / 10</td>
- <td>Tested with node.js 0.8 and 0.10</td>
- </tr>
- </table>
- <h3>Getting help</h3>
- <p>
- Having trouble ? We'd like to help !
- </p>
- <ul>
- <li>
- Try the <a href="{{site.baseurl}}/documentation/faq.html">FAQ</a>, it has
- answers to common questions.
- </li>
- <li>
- If you're looking for informations about a specific method, try the
- <a href="{{site.baseurl}}/documentation/api_jszip.html">documentation</a>.
- </li>
- <li>
- Check the
- <a href="{{site.baseurl}}/documentation/examples.html">examples</a>.
- </li>
- <li>
- Report bugs in our
- <a href="https://github.com/Stuk/jszip/issues">Bug tracker</a>.
- </li>
- </ul>
- <h3>Test status</h3>
- <dl class="dl-horizontal">
- <dt>Travis build :</dt>
- <dd>
- <a href="http://travis-ci.org/Stuk/jszip">
- <img src="https://api.travis-ci.org/Stuk/jszip.svg?branch=master" alt="" />
- </a>
- </dd>
- <dt>Saucelabs build :</dt>
- <dd>
- <a href="https://saucelabs.com/u/jszip">
- <img src="https://saucelabs.com/browser-matrix/jszip.svg" alt="" />
- </a>
- </dd>
- <dt>Live tests :</dt>
- <dd>
- <a href="{{site.baseurl}}/test/">See for yourself !</a>
- </dd>
- </dl>
|