w-zip 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/mZip.html CHANGED
@@ -14,6 +14,7 @@
14
14
  <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
15
  <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
16
  <script src="scripts/nav.js" defer></script>
17
+
17
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
19
  </head>
19
20
  <body>
@@ -27,7 +28,9 @@
27
28
 
28
29
  <nav >
29
30
 
31
+
30
32
  <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="m7z.html">m7z</a><ul class='methods'><li data-type='method'><a href="m7z.html#.setProg">setProg</a></li><li data-type='method'><a href="m7z.html#.unzip">unzip</a></li><li data-type='method'><a href="m7z.html#.zipFile">zipFile</a></li><li data-type='method'><a href="m7z.html#.zipFolder">zipFolder</a></li></ul></li><li><a href="mZip.html">mZip</a><ul class='methods'><li data-type='method'><a href="mZip.html#.unzip">unzip</a></li><li data-type='method'><a href="mZip.html#.zipFile">zipFile</a></li><li data-type='method'><a href="mZip.html#.zipFolder">zipFolder</a></li></ul></li></ul>
33
+
31
34
  </nav>
32
35
 
33
36
  <div id="main">
@@ -45,7 +48,9 @@
45
48
  <header>
46
49
 
47
50
  <h2>
48
- mZip
51
+
52
+ mZip
53
+
49
54
  </h2>
50
55
 
51
56
 
@@ -67,6 +72,10 @@
67
72
 
68
73
 
69
74
  <dl class="details">
75
+
76
+ <dt class="tag-description">Description:</dt>
77
+ <dd class="tag-description"><ul class="dummy"><li><p>Zip處理</p></li></ul></dd>
78
+
70
79
 
71
80
 
72
81
  <dt class="tag-source">Source:</dt>
@@ -110,19 +119,13 @@
110
119
 
111
120
 
112
121
 
113
- <div class="description usertext">
114
- <p>Zip處理</p>
115
- </div>
116
-
117
-
118
-
119
122
 
120
123
 
121
124
 
122
125
 
123
126
 
124
127
 
125
- <h5>Example</h5>
128
+ <h5 class="h5-examples">Example</h5>
126
129
 
127
130
  <pre class="prettyprint"><code>import wz from 'w-zip'
128
131
  //zipFile
129
132
  console.log('zipFile before')
130
133
  console.log('zipFile', await wz.mZip.zipFile(fpSrc1, fpZip1))
131
134
  console.log('zipFile after')
132
135
  //zipFolder
133
136
  console.log('zipFolder before')
134
137
  console.log('zipFolder', await wz.mZip.zipFolder(fpSrc2, fpZip2))
135
138
  console.log('zipFolder after')
136
139
  //zipFolder with password
137
140
  console.log('zipFolder with password before')
138
141
  console.log('zipFolder with password', await wz.mZip.zipFolder(fpSrc2, fpZip2PW, { pw }))
139
142
  console.log('zipFolder with password after')
140
143
  //unzip
141
144
  console.log('unzip1 before')
142
145
  console.log('unzip1', await wz.mZip.unzip(fpZip1, fpUnzipExtract + '/test1'))
143
146
  console.log('unzip1 after')
144
147
  //unzip
145
148
  console.log('unzip2 before')
146
149
  console.log('unzip2', await wz.mZip.unzip(fpZip2, fpUnzipExtract + '/test2'))
147
150
  console.log('unzip2 after')
148
151
  //unzip with password
149
152
  console.log('unzip2 with password before')
150
153
  console.log('unzip2 with password', await wz.mZip.unzip(fpZip2PW, fpUnzipExtract + '/test2PW', { pw }))
151
154
  console.log('unzip2 with password after')
152
155
  .catch((err) => {
153
156
  console.log(err)
154
157
  })
155
158
 
@@ -143,7 +146,7 @@
143
146
 
144
147
 
145
148
 
146
- <h5>Returns:</h5>
149
+ <h5 class="h5-returns">Returns:</h5>
147
150
 
148
151
 
149
152
  <div class="param-desc">
@@ -161,6 +164,7 @@
161
164
  <span class="param-type">Object</span>
162
165
 
163
166
 
167
+
164
168
  </dd>
165
169
  </dl>
166
170
 
@@ -194,7 +198,7 @@
194
198
 
195
199
 
196
200
 
197
- <h4 class="name" id=".unzip"><span class="type-signature">(async, static) </span>unzip<span class="signature">(fpSrc, fpTar, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
201
+ <h4 class="name" id=".unzip"><span class="type-signature type-signature-async, static">(async, static) </span>unzip<span class="signature">(fpSrc, fpTar, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
198
202
 
199
203
 
200
204
 
@@ -202,6 +206,10 @@
202
206
 
203
207
 
204
208
  <dl class="details">
209
+
210
+ <dt class="tag-description">Description:</dt>
211
+ <dd class="tag-description"><ul class="dummy"><li><p>解壓縮檔案至資料夾</p></li></ul></dd>
212
+
205
213
 
206
214
 
207
215
  <dt class="tag-source">Source:</dt>
@@ -245,12 +253,6 @@
245
253
 
246
254
 
247
255
 
248
- <div class="description usertext">
249
- <p>解壓縮檔案至資料夾</p>
250
- </div>
251
-
252
-
253
-
254
256
 
255
257
 
256
258
 
@@ -259,7 +261,7 @@
259
261
 
260
262
 
261
263
 
262
- <h5>Parameters:</h5>
264
+ <h5 class="h5-parameters">Parameters:</h5>
263
265
 
264
266
 
265
267
  <table class="params">
@@ -297,6 +299,7 @@
297
299
  <span class="param-type">String</span>
298
300
 
299
301
 
302
+
300
303
 
301
304
  </td>
302
305
 
@@ -332,6 +335,7 @@
332
335
  <span class="param-type">String</span>
333
336
 
334
337
 
338
+
335
339
 
336
340
  </td>
337
341
 
@@ -367,6 +371,7 @@
367
371
  <span class="param-type">Object</span>
368
372
 
369
373
 
374
+
370
375
 
371
376
  </td>
372
377
 
@@ -429,6 +434,7 @@
429
434
  <span class="param-type">String</span>
430
435
 
431
436
 
437
+
432
438
 
433
439
  </td>
434
440
 
@@ -481,7 +487,7 @@
481
487
 
482
488
 
483
489
 
484
- <h5>Returns:</h5>
490
+ <h5 class="h5-returns">Returns:</h5>
485
491
 
486
492
 
487
493
  <div class="param-desc">
@@ -499,6 +505,7 @@
499
505
  <span class="param-type">Promise</span>
500
506
 
501
507
 
508
+
502
509
  </dd>
503
510
  </dl>
504
511
 
@@ -511,7 +518,7 @@
511
518
 
512
519
 
513
520
 
514
- <h4 class="name" id=".zipFile"><span class="type-signature">(async, static) </span>zipFile<span class="signature">(fpSrc, fpTar, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
521
+ <h4 class="name" id=".zipFile"><span class="type-signature type-signature-async, static">(async, static) </span>zipFile<span class="signature">(fpSrc, fpTar, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
515
522
 
516
523
 
517
524
 
@@ -519,6 +526,10 @@
519
526
 
520
527
 
521
528
  <dl class="details">
529
+
530
+ <dt class="tag-description">Description:</dt>
531
+ <dd class="tag-description"><ul class="dummy"><li><p>壓縮檔案</p></li></ul></dd>
532
+
522
533
 
523
534
 
524
535
  <dt class="tag-source">Source:</dt>
@@ -562,12 +573,6 @@
562
573
 
563
574
 
564
575
 
565
- <div class="description usertext">
566
- <p>壓縮檔案</p>
567
- </div>
568
-
569
-
570
-
571
576
 
572
577
 
573
578
 
@@ -576,7 +581,7 @@
576
581
 
577
582
 
578
583
 
579
- <h5>Parameters:</h5>
584
+ <h5 class="h5-parameters">Parameters:</h5>
580
585
 
581
586
 
582
587
  <table class="params">
@@ -614,6 +619,7 @@
614
619
  <span class="param-type">String</span>
615
620
 
616
621
 
622
+
617
623
 
618
624
  </td>
619
625
 
@@ -649,6 +655,7 @@
649
655
  <span class="param-type">String</span>
650
656
 
651
657
 
658
+
652
659
 
653
660
  </td>
654
661
 
@@ -684,6 +691,7 @@
684
691
  <span class="param-type">Object</span>
685
692
 
686
693
 
694
+
687
695
 
688
696
  </td>
689
697
 
@@ -744,6 +752,7 @@
744
752
  <span class="param-type">Integer</span>
745
753
 
746
754
 
755
+
747
756
 
748
757
  </td>
749
758
 
@@ -777,6 +786,7 @@
777
786
  <span class="param-type">String</span>
778
787
 
779
788
 
789
+
780
790
 
781
791
  </td>
782
792
 
@@ -823,7 +833,7 @@
823
833
 
824
834
 
825
835
 
826
- <h5>Returns:</h5>
836
+ <h5 class="h5-returns">Returns:</h5>
827
837
 
828
838
 
829
839
  <div class="param-desc">
@@ -841,6 +851,7 @@
841
851
  <span class="param-type">Promise</span>
842
852
 
843
853
 
854
+
844
855
  </dd>
845
856
  </dl>
846
857
 
@@ -853,7 +864,7 @@
853
864
 
854
865
 
855
866
 
856
- <h4 class="name" id=".zipFolder"><span class="type-signature">(async, static) </span>zipFolder<span class="signature">(fpSrc, fpTar, level)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
867
+ <h4 class="name" id=".zipFolder"><span class="type-signature type-signature-async, static">(async, static) </span>zipFolder<span class="signature">(fpSrc, fpTar, level)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
857
868
 
858
869
 
859
870
 
@@ -861,6 +872,10 @@
861
872
 
862
873
 
863
874
  <dl class="details">
875
+
876
+ <dt class="tag-description">Description:</dt>
877
+ <dd class="tag-description"><ul class="dummy"><li><p>壓縮資料夾</p></li></ul></dd>
878
+
864
879
 
865
880
 
866
881
  <dt class="tag-source">Source:</dt>
@@ -904,11 +919,6 @@
904
919
 
905
920
 
906
921
 
907
- <div class="description usertext">
908
- <p>壓縮資料夾</p>
909
- </div>
910
-
911
-
912
922
 
913
923
 
914
924
 
@@ -917,8 +927,7 @@
917
927
 
918
928
 
919
929
 
920
-
921
- <h5>Parameters:</h5>
930
+ <h5 class="h5-parameters">Parameters:</h5>
922
931
 
923
932
 
924
933
  <table class="params">
@@ -952,6 +961,7 @@
952
961
  <span class="param-type">String</span>
953
962
 
954
963
 
964
+
955
965
 
956
966
  </td>
957
967
 
@@ -975,6 +985,7 @@
975
985
  <span class="param-type">String</span>
976
986
 
977
987
 
988
+
978
989
 
979
990
  </td>
980
991
 
@@ -998,6 +1009,7 @@
998
1009
  <span class="param-type">Integer</span>
999
1010
 
1000
1011
 
1012
+
1001
1013
 
1002
1014
  </td>
1003
1015
 
@@ -1027,7 +1039,7 @@
1027
1039
 
1028
1040
 
1029
1041
 
1030
- <h5>Returns:</h5>
1042
+ <h5 class="h5-returns">Returns:</h5>
1031
1043
 
1032
1044
 
1033
1045
  <div class="param-desc">
@@ -1045,6 +1057,7 @@
1045
1057
  <span class="param-type">Promise</span>
1046
1058
 
1047
1059
 
1060
+
1048
1061
  </dd>
1049
1062
  </dl>
1050
1063
 
@@ -1072,7 +1085,7 @@
1072
1085
  <br class="clear">
1073
1086
 
1074
1087
  <footer>
1075
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 16:09:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1088
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Mar 29 2023 15:18:57 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1076
1089
  </footer>
1077
1090
 
1078
1091
  <script>prettyPrint();</script>
@@ -14,6 +14,7 @@
14
14
  <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
15
  <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
16
  <script src="scripts/nav.js" defer></script>
17
+
17
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
19
  </head>
19
20
  <body>
@@ -27,7 +28,9 @@
27
28
 
28
29
  <nav >
29
30
 
31
+
30
32
  <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="m7z.html">m7z</a><ul class='methods'><li data-type='method'><a href="m7z.html#.setProg">setProg</a></li><li data-type='method'><a href="m7z.html#.unzip">unzip</a></li><li data-type='method'><a href="m7z.html#.zipFile">zipFile</a></li><li data-type='method'><a href="m7z.html#.zipFolder">zipFolder</a></li></ul></li><li><a href="mZip.html">mZip</a><ul class='methods'><li data-type='method'><a href="mZip.html#.unzip">unzip</a></li><li data-type='method'><a href="mZip.html#.zipFile">zipFile</a></li><li data-type='method'><a href="mZip.html#.zipFolder">zipFolder</a></li></ul></li></ul>
33
+
31
34
  </nav>
32
35
 
33
36
  <div id="main">
@@ -430,7 +433,7 @@ export default mZip()
430
433
  <br class="clear">
431
434
 
432
435
  <footer>
433
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 16:09:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
436
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Mar 29 2023 15:18:57 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
434
437
  </footer>
435
438
 
436
439
  <script>prettyPrint();</script>
@@ -1,15 +1,34 @@
1
1
  function hideAllButCurrent(){
2
2
  //by default all submenut items are hidden
3
3
  //but we need to rehide them for search
4
+ document.querySelectorAll("nav > ul").forEach(function(parent) {
5
+ if (parent.className.indexOf("collapse_top") !== -1) {
6
+ parent.style.display = "none";
7
+ }
8
+ });
4
9
  document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
5
10
  parent.style.display = "none";
6
11
  });
12
+ document.querySelectorAll("nav > h3").forEach(function(section) {
13
+ if (section.className.indexOf("collapsed_header") !== -1) {
14
+ section.addEventListener("click", function(){
15
+ if (section.nextSibling.style.display === "none") {
16
+ section.nextSibling.style.display = "block";
17
+ } else {
18
+ section.nextSibling.style.display = "none";
19
+ }
20
+ });
21
+ }
22
+ });
7
23
 
8
24
  //only current page (if it exists) should be opened
9
25
  var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
10
26
  document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
11
27
  var href = parent.attributes.href.value.replace(/\.html/, '');
12
28
  if (file === href) {
29
+ if (parent.parentNode.parentNode.className.indexOf("collapse_top") !== -1) {
30
+ parent.parentNode.parentNode.style.display = "block";
31
+ }
13
32
  parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
14
33
  elem.style.display = "block";
15
34
  });
@@ -0,0 +1,28 @@
1
+ if (typeof fetch === 'function') {
2
+ const init = () => {
3
+ if (typeof scrollToNavItem !== 'function') return false
4
+ scrollToNavItem()
5
+ // hideAllButCurrent not always loaded
6
+ if (typeof hideAllButCurrent === 'function') hideAllButCurrent()
7
+ return true
8
+ }
9
+ fetch('./nav.inc.html')
10
+ .then(response => response.ok ? response.text() : `${response.url} => ${response.status} ${response.statusText}`)
11
+ .then(body => {
12
+ document.querySelector('nav').innerHTML += body
13
+ // nav.js should be quicker to load than nav.inc.html, a fallback just in case
14
+ return init()
15
+ })
16
+ .then(done => {
17
+ if (done) return
18
+ let i = 0
19
+ ;(function waitUntilNavJs () {
20
+ if (init()) return
21
+ if (i++ < 100) return setTimeout(waitUntilNavJs, 300)
22
+ console.error(Error('nav.js not loaded after 30s waiting for it'))
23
+ })()
24
+ })
25
+ .catch(error => console.error(error))
26
+ } else {
27
+ console.error(Error('Browser too old to display commonNav (remove commonNav docdash option)'))
28
+ }
@@ -33,6 +33,9 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
33
33
  document.querySelectorAll("nav > ul > li").forEach(function(elem) {
34
34
  elem.style.display = "block";
35
35
  });
36
+ document.querySelectorAll("nav > ul").forEach(function(elem) {
37
+ elem.style.display = "block";
38
+ });
36
39
  //hide all results
37
40
  document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
38
41
  elem.style.display = "none";
@@ -79,5 +82,18 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
79
82
  parent.style.display = "none";
80
83
  }
81
84
  });
85
+ document.querySelectorAll("nav > ul.collapse_top").forEach(function(parent) {
86
+ var countVisible = 0;
87
+ parent.querySelectorAll("li").forEach(function(elem) {
88
+ if (elem.style.display !== "none") {
89
+ countVisible++;
90
+ }
91
+ });
92
+
93
+ if (countVisible == 0) {
94
+ //has no child at all and does not contain text
95
+ parent.style.display = "none";
96
+ }
97
+ });
82
98
  }
83
99
  });
@@ -162,12 +162,19 @@ h6 {
162
162
  }
163
163
 
164
164
 
165
- tt, code, kbd, samp {
165
+ tt, code, kbd, samp, pre {
166
166
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
167
167
  background: #f4f4f4;
168
+ }
169
+
170
+ tt, code, kbd, samp{
168
171
  padding: 1px 5px;
169
172
  }
170
173
 
174
+ pre {
175
+ padding-bottom: 1em;
176
+ }
177
+
171
178
  .class-description {
172
179
  font-size: 130%;
173
180
  line-height: 140%;
@@ -242,6 +249,10 @@ nav h3 {
242
249
  color: #000;
243
250
  }
244
251
 
252
+ nav h3.collapsed_header {
253
+ cursor: pointer;
254
+ }
255
+
245
256
  nav ul {
246
257
  font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
247
258
  font-size: 100%;
@@ -762,4 +773,4 @@ html[data-search-mode] .level-hide {
762
773
  font-weight: 300;
763
774
  font-style: normal;
764
775
 
765
- }
776
+ }
@@ -76,4 +76,5 @@
76
76
  ol.linenums {
77
77
  margin-top: 0;
78
78
  margin-bottom: 0;
79
+ padding-bottom: 2px;
79
80
  }
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "w-zip",
3
- "version": "1.0.14",
4
- "description": "A compression tool with zip and 7z.",
3
+ "version": "1.0.16",
5
4
  "main": "dist/w-zip.umd.js",
6
5
  "dependencies": {
7
- "archiver": "^5.3.0",
6
+ "archiver": "^5.3.1",
8
7
  "archiver-zip-encrypted": "^1.0.11",
9
8
  "unzipper": "^0.10.11",
10
9
  "lodash": "^4.17.21",
11
- "wsemi": "^1.6.54"
10
+ "wsemi": "^1.7.1"
12
11
  },
13
12
  "devDependencies": {
14
- "w-package-tools": "^1.0.65"
13
+ "w-package-tools": "^1.0.68"
15
14
  },
16
15
  "scripts": {
17
16
  "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
@@ -30,9 +29,5 @@
30
29
  "nodejs"
31
30
  ],
32
31
  "author": "yuda-lyu(semisphere)",
33
- "license": "MIT",
34
- "bugs": {
35
- "url": "https://github.com/yuda-lyu/w-zip/issues"
36
- },
37
- "homepage": "https://github.com/yuda-lyu/w-zip#readme"
32
+ "license": "MIT"
38
33
  }