index.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. ---
  2. title: JSZip
  3. layout: default
  4. section: main
  5. ---
  6. <div class="row">
  7. <div class="col-md-5">
  8. JSZip is a javascript library for creating, reading and editing .zip files, with a
  9. lovely and simple API.
  10. </div>
  11. <div class="col-md-7">
  12. <p>
  13. <strong>Current version</strong> : v2.6.0
  14. </p>
  15. <p>
  16. <strong>License</strong> : JSZip is dual-licensed. You may use it under the
  17. MIT license <em>or</em> the GPLv3 license. See
  18. <a href="https://github.com/Stuk/jszip/blob/master/LICENSE.markdown">LICENSE.markdown</a>.
  19. </p>
  20. </div>
  21. <div class="row">
  22. <div class="col-md-5">
  23. <h3>Example</h3>
  24. <script type="text/javascript">
  25. imgData = "R0lGODdhBQAFAIACAAAAAP/eACwAAAAABQAFAAACCIwPkWerClIBADs=";
  26. jQuery(function($) {
  27. if(!JSZip.support.blob) {
  28. $("#demo-not-supported").removeClass("hidden");
  29. $("#demo").hide();
  30. return;
  31. }
  32. $("#demo").click(function () {
  33. try {
  34. eval($("#demo-code").val());
  35. $("#status")
  36. .removeClass()
  37. .addClass("text-success")
  38. .text("Done!");
  39. }
  40. catch (e) {
  41. $("#status")
  42. .removeClass()
  43. .addClass("text-danger")
  44. .text(e);
  45. }
  46. });
  47. });
  48. </script>
  49. <textarea class="form-control" id="demo-code" rows="7" spellcheck="false">
  50. var zip = new JSZip();
  51. zip.file("Hello.txt", "Hello World\n");
  52. var img = zip.folder("images");
  53. img.file("smile.gif", imgData, {base64: true});
  54. var content = zip.generate({type:"blob"});
  55. // see FileSaver.js
  56. saveAs(content, "example.zip");</textarea>
  57. <button id="demo" class="btn btn-primary">Run!</button>
  58. <span id="status"></span>
  59. <div id="demo-not-supported" class="alert alert-danger hidden">
  60. This browser doesn't support blobs, this demo won't work :(
  61. See <a href="{{site.baseurl}}/documentation/howto/write_zip.html" class="alert-link">here for more info</a>.
  62. </div>
  63. </div>
  64. <div class="col-md-7">
  65. <h3>Installation</h3>
  66. <p>
  67. <strong>With npm</strong> : <code>npm install jszip</code>
  68. </p>
  69. <p>
  70. <strong>With bower</strong> : <code>bower install Stuk/jszip</code>
  71. </p>
  72. <p>
  73. <strong>With component</strong> : <code>component install Stuk/jszip</code>
  74. </p>
  75. <p>
  76. <strong>Manually</strong> : <a href="http://github.com/Stuk/jszip/zipball/master">download JSZip</a>
  77. and include the file <code>dist/jszip.js</code> or <code>dist/jszip.min.js</code>
  78. </p>
  79. <br>
  80. <p>
  81. Installed ? Great ! You can now check our
  82. <a href="{{site.baseurl}}/documentation/examples.html">guides and examples !</a>
  83. </p>
  84. </div>
  85. </div>
  86. <h3>Support</h3>
  87. <table class="browser_support">
  88. <tr>
  89. <th class="support_op">Opera</th>
  90. <th class="support_ff">Firefox</th>
  91. <th class="support_sf">Safari</th>
  92. <th class="support_cr">Chrome</th>
  93. <th class="support_ie">Internet Explorer</th>
  94. <th class="support_nd">Node.js</th>
  95. </tr>
  96. <tr>
  97. <td>Yes</td>
  98. <td>Yes</td>
  99. <td>Yes</td>
  100. <td>Yes</td>
  101. <td>Yes</td>
  102. <td>Yes</td>
  103. </tr>
  104. <tr>
  105. <td>Tested with the latest version</td>
  106. <td>Tested with 3.0 / 3.6 / latest version</td>
  107. <td>Tested with the latest version</td>
  108. <td>Tested with the latest version</td>
  109. <td>Tested with IE 6 / 7 / 8 / 9 / 10</td>
  110. <td>Tested with node.js 0.8 and 0.10</td>
  111. </tr>
  112. </table>
  113. <h3>Getting help</h3>
  114. <p>
  115. Having trouble ? We'd like to help !
  116. </p>
  117. <ul>
  118. <li>
  119. Try the <a href="{{site.baseurl}}/documentation/faq.html">FAQ</a>, it has
  120. answers to common questions.
  121. </li>
  122. <li>
  123. If you're looking for informations about a specific method, try the
  124. <a href="{{site.baseurl}}/documentation/api_jszip.html">documentation</a>.
  125. </li>
  126. <li>
  127. Check the
  128. <a href="{{site.baseurl}}/documentation/examples.html">examples</a>.
  129. </li>
  130. <li>
  131. Report bugs in our
  132. <a href="https://github.com/Stuk/jszip/issues">Bug tracker</a>.
  133. </li>
  134. </ul>
  135. <h3>Test status</h3>
  136. <dl class="dl-horizontal">
  137. <dt>Travis build :</dt>
  138. <dd>
  139. <a href="http://travis-ci.org/Stuk/jszip">
  140. <img src="https://api.travis-ci.org/Stuk/jszip.svg?branch=master" alt="" />
  141. </a>
  142. </dd>
  143. <dt>Saucelabs build :</dt>
  144. <dd>
  145. <a href="https://saucelabs.com/u/jszip">
  146. <img src="https://saucelabs.com/browser-matrix/jszip.svg" alt="" />
  147. </a>
  148. </dd>
  149. <dt>Live tests :</dt>
  150. <dd>
  151. <a href="{{site.baseurl}}/test/">See for yourself !</a>
  152. </dd>
  153. </dl>