w-docx-split 1.0.0

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.
Files changed (61) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.jsdoc +25 -0
  5. package/LICENSE +21 -0
  6. package/README.md +28 -0
  7. package/SECURITY.md +5 -0
  8. package/babel.config.js +16 -0
  9. package/dist/w-docx-split.umd.js +7 -0
  10. package/dist/w-docx-split.umd.js.map +1 -0
  11. package/docs/WDocxSplit.mjs.html +199 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  30. package/docs/global.html +519 -0
  31. package/docs/index.html +84 -0
  32. package/docs/scripts/collapse.js +39 -0
  33. package/docs/scripts/commonNav.js +28 -0
  34. package/docs/scripts/linenumber.js +25 -0
  35. package/docs/scripts/nav.js +12 -0
  36. package/docs/scripts/polyfill.js +4 -0
  37. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  38. package/docs/scripts/prettify/lang-css.js +2 -0
  39. package/docs/scripts/prettify/prettify.js +28 -0
  40. package/docs/scripts/search.js +99 -0
  41. package/docs/styles/jsdoc.css +776 -0
  42. package/docs/styles/prettify.css +80 -0
  43. package/g.mjs +29 -0
  44. package/package.json +32 -0
  45. package/script.txt +17 -0
  46. package/scripts/install.mjs +30 -0
  47. package/src/WDocxSplit.mjs +127 -0
  48. package/src/downloadFiles.mjs +23 -0
  49. package/srcPython/build.bat +9 -0
  50. package/srcPython/run.bat +4 -0
  51. package/srcPython/splitDocx.py +271 -0
  52. package/srcPython/splitDocx.spec +37 -0
  53. package/srcPython//350/252/252/346/230/216.txt +24 -0
  54. package/test/WDocxSplit.test.mjs +40 -0
  55. package/test/docin.docx +0 -0
  56. package/test/outTrue/001.docx +0 -0
  57. package/test/outTrue/002.docx +0 -0
  58. package/toolg/addVersion.mjs +4 -0
  59. package/toolg/cleanFolder.mjs +4 -0
  60. package/toolg/gDistRollup.mjs +28 -0
  61. package/toolg/modifyReadme.mjs +4 -0
@@ -0,0 +1,40 @@
1
+ import fs from 'fs'
2
+ import w from 'wsemi'
3
+ import assert from 'assert'
4
+ import WDocxSplit from '../src/WDocxSplit.mjs'
5
+
6
+
7
+ function isWindows() {
8
+ return process.platform === 'win32'
9
+ }
10
+
11
+
12
+ describe('WDocxSplit', function() {
13
+
14
+ //check
15
+ if (!isWindows()) {
16
+ return
17
+ }
18
+
19
+ let fpOut = `./test/out/001.docx`
20
+ let fpOutTrue = `./test/outTrue/001.docx`
21
+
22
+ let fpIn = `./test/docin.docx`
23
+ let strSep = '[systag:sepline]'
24
+ let fdOut = `./test/out`
25
+ let opt = {
26
+ padZero: 3,
27
+ }
28
+
29
+ it('convert', async function() {
30
+ await WDocxSplit(fpIn, strSep, fdOut, opt)
31
+ let r = (fs.statSync(fpOut)).size
32
+ let rr = (fs.statSync(fpOutTrue)).size
33
+ //轉出docx檔案每次不同, 改用門檻比對
34
+ // console.log('r', r, 'rr', rr)
35
+ let b = r > 12000 && rr > 12000
36
+ w.fsDeleteFolder(fdOut)
37
+ assert.strict.deepEqual(true, b)
38
+ })
39
+
40
+ })
Binary file
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ import addVersion from 'w-package-tools/src/addVersion.mjs'
2
+
3
+
4
+ addVersion()
@@ -0,0 +1,4 @@
1
+ import cleanFolder from 'w-package-tools/src/cleanFolder.mjs'
2
+
3
+
4
+ cleanFolder('docs')
@@ -0,0 +1,28 @@
1
+ import rollupFiles from 'w-package-tools/src/rollupFiles.mjs'
2
+ import getFiles from 'w-package-tools/src/getFiles.mjs'
3
+
4
+
5
+ let fdSrc = './src'
6
+ let fdTar = './dist'
7
+
8
+
9
+ rollupFiles({
10
+ fns: 'WDocxSplit.mjs',
11
+ fdSrc,
12
+ fdTar,
13
+ hookNameDist: () => 'w-docx-split',
14
+ // nameDistType: 'kebabCase', //直接由hookNameDist給予
15
+ globals: {
16
+ 'path': 'path',
17
+ 'fs': 'fs',
18
+ 'process': 'process',
19
+ 'child_process': 'child_process',
20
+ },
21
+ external: [
22
+ 'path',
23
+ 'fs',
24
+ 'process',
25
+ 'child_process',
26
+ ],
27
+ })
28
+
@@ -0,0 +1,4 @@
1
+ import modifyReadme from 'w-package-tools/src/modifyReadme.mjs'
2
+
3
+
4
+ modifyReadme()