w-zip 1.0.18 → 1.0.19

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.
@@ -9,7 +9,7 @@ jobs:
9
9
 
10
10
  strategy:
11
11
  matrix:
12
- node-version: [18.x]
12
+ node-version: [20.x]
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v2
package/dist/w-zip.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-zip v1.0.18
2
+ * w-zip v1.0.19
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 23:20:19 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sun Mar 24 2024 15:36:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
package/docs/m7z.html CHANGED
@@ -1403,7 +1403,7 @@
1403
1403
  <br class="clear">
1404
1404
 
1405
1405
  <footer>
1406
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 23:20:19 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1406
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sun Mar 24 2024 15:36:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1407
1407
  </footer>
1408
1408
 
1409
1409
  <script>prettyPrint();</script>
package/docs/m7z.mjs.html CHANGED
@@ -46,7 +46,7 @@
46
46
  <section>
47
47
  <article>
48
48
  <pre class="prettyprint source linenums"><code>import fs from 'fs'
49
- import get from 'lodash-es/get'
49
+ import get from 'lodash-es/get.js'
50
50
  import execScript from 'wsemi/src/execScript.mjs'
51
51
  import getFileName from 'wsemi/src/getFileName.mjs'
52
52
  import checkTarget from './checkTarget.mjs'
@@ -359,7 +359,7 @@ export default m7z()
359
359
  <br class="clear">
360
360
 
361
361
  <footer>
362
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 23:20:19 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
362
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sun Mar 24 2024 15:36:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
363
363
  </footer>
364
364
 
365
365
  <script>prettyPrint();</script>
package/docs/mZip.html CHANGED
@@ -1085,7 +1085,7 @@
1085
1085
  <br class="clear">
1086
1086
 
1087
1087
  <footer>
1088
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 23:20:19 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 Sun Mar 24 2024 15:36:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1089
1089
  </footer>
1090
1090
 
1091
1091
  <script>prettyPrint();</script>
@@ -50,7 +50,7 @@ import fs from 'fs'
50
50
  import archiver from 'archiver'
51
51
  import archiverEnc from 'archiver-zip-encrypted'
52
52
  import unzipper from 'unzipper'
53
- import get from 'lodash-es/get'
53
+ import get from 'lodash-es/get.js'
54
54
  import genPm from 'wsemi/src/genPm.mjs'
55
55
  import pmMap from 'wsemi/src/pmMap.mjs'
56
56
  import getFileName from 'wsemi/src/getFileName.mjs'
@@ -433,7 +433,7 @@ export default mZip()
433
433
  <br class="clear">
434
434
 
435
435
  <footer>
436
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 23:20:19 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 Sun Mar 24 2024 15:36:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
437
437
  </footer>
438
438
 
439
439
  <script>prettyPrint();</script>
package/g-7z.mjs CHANGED
@@ -12,6 +12,10 @@ let fpZip2 = fpUnzip + '/test2.7z'
12
12
  let fpZip2PW = fpUnzip + '/test2PW.7z'
13
13
  let pw = 'abc'
14
14
 
15
+ let fpUnzip1 = fpUnzipExtract + '/test1'
16
+ let fpUnzip2 = fpUnzipExtract + '/test2'
17
+ let fpUnzip2PW = fpUnzipExtract + '/test2'
18
+
15
19
  //fsDeleteFolder
16
20
  w.fsDeleteFolder(fpUnzip)
17
21
 
@@ -35,15 +39,15 @@ async function test() {
35
39
 
36
40
  //unzip
37
41
  console.log('unzip1')
38
- console.log((await wz.m7z.unzip(fpZip1, fpUnzipExtract + '/test1')).state)
42
+ console.log((await wz.m7z.unzip(fpZip1, fpUnzip1)).state)
39
43
 
40
44
  //unzip
41
45
  console.log('unzip2')
42
- console.log((await wz.m7z.unzip(fpZip2, fpUnzipExtract + '/test2')).state)
46
+ console.log((await wz.m7z.unzip(fpZip2, fpUnzip2)).state)
43
47
 
44
48
  //unzip with password
45
49
  console.log('unzip2 with password')
46
- console.log((await wz.m7z.unzip(fpZip2PW, fpUnzipExtract + '/test2PW', { pw })).state)
50
+ console.log((await wz.m7z.unzip(fpZip2PW, fpUnzip2PW, { pw })).state)
47
51
 
48
52
  console.log('finish')
49
53
  }
package/g-zip.mjs CHANGED
@@ -12,6 +12,10 @@ let fpZip2 = fpUnzip + '/test2.zip'
12
12
  let fpZip2PW = fpUnzip + '/test2PW.zip'
13
13
  let pw = 'abc'
14
14
 
15
+ let fpUnzip1 = fpUnzipExtract + '/test1'
16
+ let fpUnzip2 = fpUnzipExtract + '/test2'
17
+ let fpUnzip2PW = fpUnzipExtract + '/test2'
18
+
15
19
  //fsDeleteFolder
16
20
  w.fsDeleteFolder(fpUnzip)
17
21
 
@@ -31,15 +35,15 @@ async function test() {
31
35
 
32
36
  //unzip
33
37
  console.log('unzip1')
34
- console.log(await wz.mZip.unzip(fpZip1, fpUnzipExtract + '/test1'))
38
+ console.log(await wz.mZip.unzip(fpZip1, fpUnzip1))
35
39
 
36
40
  //unzip
37
41
  console.log('unzip2')
38
- console.log(await wz.mZip.unzip(fpZip2, fpUnzipExtract + '/test2'))
42
+ console.log(await wz.mZip.unzip(fpZip2, fpUnzip2))
39
43
 
40
44
  //unzip with password
41
45
  console.log('unzip2 with password')
42
- console.log(await wz.mZip.unzip(fpZip2PW, fpUnzipExtract + '/test2PW', { pw }))
46
+ console.log(await wz.mZip.unzip(fpZip2PW, fpUnzip2PW, { pw }))
43
47
 
44
48
  console.log('finish')
45
49
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "w-zip",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "main": "dist/w-zip.umd.js",
5
5
  "dependencies": {
6
6
  "archiver": "^7.0.1",
7
7
  "archiver-zip-encrypted": "^1.0.11",
8
8
  "unzipper": "^0.10.14",
9
9
  "lodash-es": "^4.17.21",
10
- "wsemi": "^1.7.47"
10
+ "wsemi": "^1.7.49"
11
11
  },
12
12
  "devDependencies": {
13
- "w-package-tools": "^1.0.73"
13
+ "w-package-tools": "^1.0.75"
14
14
  },
15
15
  "scripts": {
16
16
  "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
package/script.txt ADDED
@@ -0,0 +1,21 @@
1
+ #node --experimental-modules --es-module-specifier-resolution=node toolg/addVersion.mjs
2
+ node --experimental-modules --es-module-specifier-resolution=node toolg/modifyReadme.mjs
3
+
4
+ node --experimental-modules --es-module-specifier-resolution=node toolg/cleanFolder.mjs
5
+ ./node_modules/.bin/jsdoc -c .jsdoc
6
+
7
+ node --experimental-modules --es-module-specifier-resolution=node toolg/gDistRollup.mjs
8
+
9
+ git add . -A
10
+ git commit -m 'modify: '
11
+ git push origin master:master
12
+
13
+ npm run deploy
14
+
15
+ #npm test
16
+
17
+ #node --experimental-modules --es-module-specifier-resolution=node g-zip.mjs
18
+ #node --experimental-modules --es-module-specifier-resolution=node g-7z.mjs
19
+
20
+ #npm publish
21
+
package/src/m7z.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import fs from 'fs'
2
- import get from 'lodash-es/get'
2
+ import get from 'lodash-es/get.js'
3
3
  import execScript from 'wsemi/src/execScript.mjs'
4
4
  import getFileName from 'wsemi/src/getFileName.mjs'
5
5
  import checkTarget from './checkTarget.mjs'
package/src/mZip.mjs CHANGED
@@ -3,7 +3,7 @@ import fs from 'fs'
3
3
  import archiver from 'archiver'
4
4
  import archiverEnc from 'archiver-zip-encrypted'
5
5
  import unzipper from 'unzipper'
6
- import get from 'lodash-es/get'
6
+ import get from 'lodash-es/get.js'
7
7
  import genPm from 'wsemi/src/genPm.mjs'
8
8
  import pmMap from 'wsemi/src/pmMap.mjs'
9
9
  import getFileName from 'wsemi/src/getFileName.mjs'
@@ -0,0 +1,80 @@
1
+ import assert from 'assert'
2
+ import w from 'wsemi'
3
+ import wz from '../src/WZip.mjs'
4
+
5
+
6
+ describe('7z', function() {
7
+
8
+ let fpUnzip = './testData/output7z'
9
+ let fpUnzipExtract = fpUnzip + '/extract'
10
+
11
+ let fpSrc1 = './testData/input/file1(中文).txt'
12
+ let fpZip1 = fpUnzip + '/test1.7z'
13
+
14
+ let fpSrc2 = './testData/input/folder1'
15
+ let fpZip2 = fpUnzip + '/test2.7z'
16
+ let fpZip2PW = fpUnzip + '/test2PW.7z'
17
+ let pw = 'abc'
18
+
19
+ let fpUnzip1 = fpUnzipExtract + '/test1'
20
+ let fpUnzip2 = fpUnzipExtract + '/test2'
21
+ let fpUnzip2PW = fpUnzipExtract + '/test2'
22
+
23
+ //fsDeleteFolder
24
+ w.fsDeleteFolder(fpUnzip)
25
+
26
+ //zipFile
27
+ // console.log('zipFile')
28
+ // console.log((await wz.m7z.zipFile(fpSrc1, fpZip1)).state)
29
+ it('zipFile by wz.m7z.zipFile(fpSrc1, fpZip1)', async function() {
30
+ await wz.m7z.zipFile(fpSrc1, fpZip1)
31
+ let rt = w.fsIsFile(fpZip1)
32
+ assert.strict.deepEqual(true, rt)
33
+ })
34
+
35
+ //zipFolder
36
+ // console.log('zipFolder')
37
+ // console.log((await wz.m7z.zipFolder(fpSrc2, fpZip2)).state)
38
+ it('zipFolder by wz.m7z.zipFolder(fpSrc2, fpZip2)', async function() {
39
+ await wz.m7z.zipFolder(fpSrc2, fpZip2)
40
+ let rt = w.fsIsFile(fpZip2)
41
+ assert.strict.deepEqual(true, rt)
42
+ })
43
+
44
+ //zipFolder with password
45
+ // console.log('zipFolder with password')
46
+ // console.log((await wz.m7z.zipFolder(fpSrc2, fpZip2PW, { pw })).state)
47
+ it('zipFolder with password by wz.m7z.zipFolder(fpSrc2, fpZip2PW, { pw })', async function() {
48
+ await wz.m7z.zipFolder(fpSrc2, fpZip2PW, { pw })
49
+ let rt = w.fsIsFile(fpZip2PW)
50
+ assert.strict.deepEqual(true, rt)
51
+ })
52
+
53
+ //unzip
54
+ // console.log('unzip1')
55
+ // console.log((await wz.m7z.unzip(fpZip1, fpUnzip1)).state)
56
+ it('unzip by wz.m7z.zipFile(fpSrc1, fpZip1)', async function() {
57
+ await wz.m7z.unzip(fpZip1, fpUnzip1)
58
+ let rt = w.fsIsFolder(fpUnzip1)
59
+ assert.strict.deepEqual(true, rt)
60
+ })
61
+
62
+ //unzip
63
+ // console.log('unzip2')
64
+ // console.log((await wz.m7z.unzip(fpZip2, fpUnzip2)).state)
65
+ it('unzip by wz.m7z.unzip(fpZip2, fpUnzip2)', async function() {
66
+ await wz.m7z.unzip(fpZip2, fpUnzip2)
67
+ let rt = w.fsIsFolder(fpUnzip2)
68
+ assert.strict.deepEqual(true, rt)
69
+ })
70
+
71
+ //unzip with password
72
+ // console.log('unzip2 with password')
73
+ // console.log((await wz.m7z.unzip(fpZip2PW, fpUnzip2PW, { pw })).state)
74
+ it('unzip with password by wz.m7z.unzip(fpZip2PW, fpUnzip2PW, { pw })', async function() {
75
+ await wz.m7z.unzip(fpZip2PW, fpUnzip2PW, { pw })
76
+ let rt = w.fsIsFolder(fpUnzip2PW)
77
+ assert.strict.deepEqual(true, rt)
78
+ })
79
+
80
+ })
@@ -0,0 +1,80 @@
1
+ import assert from 'assert'
2
+ import w from 'wsemi'
3
+ import wz from '../src/WZip.mjs'
4
+
5
+
6
+ describe('zip', function() {
7
+
8
+ let fpUnzip = './testData/outputZip'
9
+ let fpUnzipExtract = fpUnzip + '/extract'
10
+
11
+ let fpSrc1 = './testData/input/file1(中文).txt'
12
+ let fpZip1 = fpUnzip + '/test1.zip'
13
+
14
+ let fpSrc2 = './testData/input/folder1'
15
+ let fpZip2 = fpUnzip + '/test2.zip'
16
+ let fpZip2PW = fpUnzip + '/test2PW.zip'
17
+ let pw = 'abc'
18
+
19
+ let fpUnzip1 = fpUnzipExtract + '/test1'
20
+ let fpUnzip2 = fpUnzipExtract + '/test2'
21
+ let fpUnzip2PW = fpUnzipExtract + '/test2'
22
+
23
+ //fsDeleteFolder
24
+ w.fsDeleteFolder(fpUnzip)
25
+
26
+ //zipFile
27
+ // console.log('zipFile')
28
+ // console.log(await wz.mZip.zipFile(fpSrc1, fpZip1))
29
+ it('zipFile by wz.mZip.zipFile(fpSrc1, fpZip1)', async function() {
30
+ await wz.mZip.zipFile(fpSrc1, fpZip1)
31
+ let rt = w.fsIsFile(fpZip1)
32
+ assert.strict.deepEqual(true, rt)
33
+ })
34
+
35
+ //zipFolder
36
+ // console.log('zipFolder')
37
+ // console.log(await wz.mZip.zipFolder(fpSrc2, fpZip2))
38
+ it('zipFolder by wz.mZip.zipFolder(fpSrc2, fpZip2)', async function() {
39
+ await wz.mZip.zipFolder(fpSrc2, fpZip2)
40
+ let rt = w.fsIsFile(fpZip2)
41
+ assert.strict.deepEqual(true, rt)
42
+ })
43
+
44
+ //zipFolder with password
45
+ // console.log('zipFolder with password')
46
+ // console.log(await wz.mZip.zipFolder(fpSrc2, fpZip2PW, { pw }))
47
+ it('zipFolder with password by wz.mZip.zipFolder(fpSrc2, fpZip2PW, { pw })', async function() {
48
+ await wz.mZip.zipFolder(fpSrc2, fpZip2PW, { pw })
49
+ let rt = w.fsIsFile(fpZip2PW)
50
+ assert.strict.deepEqual(true, rt)
51
+ })
52
+
53
+ //unzip
54
+ // console.log('unzip1')
55
+ // console.log(await wz.mZip.unzip(fpZip1, fpUnzip1))
56
+ it('unzip by wz.mZip.unzip(fpZip1, fpUnzip1)', async function() {
57
+ await wz.mZip.unzip(fpZip1, fpUnzip1)
58
+ let rt = w.fsIsFolder(fpUnzip1)
59
+ assert.strict.deepEqual(true, rt)
60
+ })
61
+
62
+ //unzip
63
+ // console.log('unzip2')
64
+ // console.log(await wz.mZip.unzip(fpZip2, fpUnzip2))
65
+ it('unzip by wz.mZip.unzip(fpZip2, fpUnzip2)', async function() {
66
+ await wz.mZip.unzip(fpZip2, fpUnzip2)
67
+ let rt = w.fsIsFolder(fpUnzip2)
68
+ assert.strict.deepEqual(true, rt)
69
+ })
70
+
71
+ //unzip with password
72
+ // console.log('unzip2 with password')
73
+ // console.log(await wz.mZip.unzip(fpZip2PW, fpUnzip2PW, { pw }))
74
+ it('unzip with password by wz.mZip.unzip(fpZip2PW, fpUnzip2PW, { pw })', async function() {
75
+ await wz.mZip.unzip(fpZip2PW, fpUnzip2PW, { pw })
76
+ let rt = w.fsIsFolder(fpUnzip2PW)
77
+ assert.strict.deepEqual(true, rt)
78
+ })
79
+
80
+ })
Binary file
Binary file
Binary file
Binary file
package/test/all.test.mjs DELETED
@@ -1,10 +0,0 @@
1
- import assert from 'assert'
2
-
3
-
4
- describe('all', function() {
5
-
6
- it('test in localhost', function() {
7
- assert.strict.deepEqual(1, 1)
8
- })
9
-
10
- })