No Description

index.html 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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> : v3.2.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="9" 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. zip.generateAsync({type:"blob"})
  55. .then(function(content) {
  56. // see FileSaver.js
  57. saveAs(content, "example.zip");
  58. });</textarea>
  59. <button id="demo" class="btn btn-primary">Run!</button>
  60. <span id="status"></span>
  61. <div id="demo-not-supported" class="alert alert-danger hidden">
  62. This browser doesn't support blobs, this demo won't work :(
  63. See <a href="{{site.baseurl}}/documentation/howto/write_zip.html" class="alert-link">here for more info</a>.
  64. </div>
  65. </div>
  66. <div class="col-md-7">
  67. <h3>Installation</h3>
  68. <p>
  69. <strong>With npm</strong> : <code>npm install jszip</code>
  70. </p>
  71. <p>
  72. <strong>With bower</strong> : <code>bower install Stuk/jszip</code>
  73. </p>
  74. <p>
  75. <strong>With component</strong> : <code>component install Stuk/jszip</code>
  76. </p>
  77. <p>
  78. <strong>Manually</strong> : <a href="http://github.com/Stuk/jszip/zipball/master">download JSZip</a>
  79. and include the file <code>dist/jszip.js</code> or <code>dist/jszip.min.js</code>
  80. </p>
  81. <br>
  82. <p>
  83. Installed ? Great ! You can now check our
  84. <a href="{{site.baseurl}}/documentation/examples.html">guides and examples !</a>
  85. </p>
  86. </div>
  87. </div>
  88. <h3>Support</h3>
  89. <table class="browser_support">
  90. <tr>
  91. <th class="support_op">Opera</th>
  92. <th class="support_ff">Firefox</th>
  93. <th class="support_sf">Safari</th>
  94. <th class="support_cr">Chrome</th>
  95. <th class="support_ie">Internet Explorer</th>
  96. <th class="support_nd">Node.js</th>
  97. </tr>
  98. <tr>
  99. <td>Yes</td>
  100. <td>Yes</td>
  101. <td>Yes</td>
  102. <td>Yes</td>
  103. <td>Yes</td>
  104. <td>Yes</td>
  105. </tr>
  106. <tr>
  107. <td>Tested with the latest version</td>
  108. <td>Tested with 3.0 / 3.6 / latest version</td>
  109. <td>Tested with the latest version</td>
  110. <td>Tested with the latest version</td>
  111. <td>Tested with IE 6 / 7 / 8 / 9 / 10</td>
  112. <td>Tested with node.js 0.10 / latest version</td>
  113. </tr>
  114. </table>
  115. <h3>Getting help</h3>
  116. <p>
  117. Having trouble ? We'd like to help !
  118. </p>
  119. <ul>
  120. <li>
  121. Try the <a href="{{site.baseurl}}/documentation/faq.html">FAQ</a>, it has
  122. answers to common questions.
  123. </li>
  124. <li>
  125. If you're looking for informations about a specific method, try the
  126. <a href="{{site.baseurl}}/documentation/api_jszip.html">documentation</a>.
  127. </li>
  128. <li>
  129. Check the
  130. <a href="{{site.baseurl}}/documentation/examples.html">examples</a>.
  131. </li>
  132. <li>
  133. Report bugs in our
  134. <a href="https://github.com/Stuk/jszip/issues">Bug tracker</a>.
  135. </li>
  136. </ul>
  137. <h3>Test status</h3>
  138. <dl class="dl-horizontal">
  139. <dt>Travis build :</dt>
  140. <dd>
  141. <a href="http://travis-ci.org/Stuk/jszip">
  142. <img src="https://api.travis-ci.org/Stuk/jszip.svg?branch=master" alt="" />
  143. </a>
  144. </dd>
  145. <dt>Saucelabs build :</dt>
  146. <dd>
  147. <a href="https://saucelabs.com/u/jszip">
  148. <img src="https://saucelabs.com/browser-matrix/jszip.svg" alt="" />
  149. </a>
  150. </dd>
  151. <dt>Live tests :</dt>
  152. <dd>
  153. <a href="{{site.baseurl}}/test/">See for yourself !</a>
  154. </dd>
  155. </dl>