w-json-stream 1.0.21 → 1.0.23

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.
@@ -287,7 +287,7 @@ export default WJsonStream
287
287
  <br class="clear">
288
288
 
289
289
  <footer>
290
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Mar 23 2024 21:08:50 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
290
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Jul 23 2026 18:07:01 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
291
291
  </footer>
292
292
 
293
293
  <script>prettyPrint();</script>
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
12
12
 
13
- <script _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
14
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
13
+ <script _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
14
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
15
15
 
16
16
  <script>
17
17
  console.log('WebWorkers(from blob) does not support IE11')
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
12
12
 
13
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
14
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
14
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
15
15
 
16
16
  <script>
17
17
 
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
12
12
 
13
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
14
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
14
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
15
15
 
16
16
  <script>
17
17
 
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
12
12
 
13
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
14
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
14
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
15
15
 
16
16
  <script>
17
17
 
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
12
12
 
13
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
14
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
14
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
15
15
 
16
16
  <script>
17
17
  console.log('ReadableStream does not support IE11')
@@ -120,7 +120,7 @@
120
120
 
121
121
  }
122
122
 
123
- let url = 'https://cdn.jsdelivr.net/npm/w-demores@1.0.14/res/data/dataFlight.json'
123
+ let url = 'https://cdn.jsdelivr.net/npm/w-demores/res/data/dataFlight.json'
124
124
  testStreamFromFetch(url)
125
125
  .catch((err) => {
126
126
  console.log(err)
@@ -8,13 +8,13 @@
8
8
  <!-- @babel/polyfill已廢棄 -->
9
9
  <script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
10
10
 
11
- <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/lodash/lodash.min.js"></script>
12
12
 
13
13
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
14
14
 
15
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/into-stream.umd.js"></script>
16
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
17
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/into-stream.umd.js"></script>
16
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
17
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
18
18
 
19
19
  <script>
20
20
  console.log('ReadableStream does not support IE11')
@@ -10,8 +10,8 @@
10
10
 
11
11
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
12
12
 
13
- <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.umd.js"></script>
14
- <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.21/dist/w-json-stream.wk.umd.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.umd.js"></script>
14
+ <script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.23/dist/w-json-stream.wk.umd.js"></script>
15
15
 
16
16
  <script>
17
17
  console.log('WritableStream does not support IE11 and Firefox')
package/docs/global.html CHANGED
@@ -1196,7 +1196,7 @@
1196
1196
  <br class="clear">
1197
1197
 
1198
1198
  <footer>
1199
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Mar 23 2024 21:08:50 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1199
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Jul 23 2026 18:07:01 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1200
1200
  </footer>
1201
1201
 
1202
1202
  <script>prettyPrint();</script>
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 Sat Mar 23 2024 21:08:50 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.5</a> on Thu Jul 23 2026 18:07:01 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
@@ -120,7 +120,7 @@
120
120
 
121
121
  }
122
122
 
123
- let url = 'https://cdn.jsdelivr.net/npm/w-demores@1.0.14/res/data/dataFlight.json'
123
+ let url = 'https://cdn.jsdelivr.net/npm/w-demores/res/data/dataFlight.json'
124
124
  testStreamFromFetch(url)
125
125
  .catch((err) => {
126
126
  console.log(err)
@@ -8,7 +8,7 @@
8
8
  <!-- @babel/polyfill已廢棄 -->
9
9
  <script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
10
10
 
11
- <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/lodash/lodash.min.js"></script>
12
12
 
13
13
  <script src="https://cdn.jsdelivr.net/npm/wsemi/dist/wsemi.umd.js"></script>
14
14
 
package/g-large.mjs CHANGED
@@ -34,7 +34,7 @@ async function testLarge() {
34
34
 
35
35
  try {
36
36
  let res = JSON.stringify(arr)
37
- console.log('JSON.stringify(arr)', res.length, res.substr(0, 200) + '...')
37
+ console.log('JSON.stringify(arr)', res.length, res.slice(0, 200) + '...')
38
38
  }
39
39
  catch (err) {
40
40
  console.log('JSON.stringify(arr) catch', err)
@@ -48,7 +48,7 @@ async function testLarge() {
48
48
 
49
49
  await json.stringify(arr)
50
50
  .then((res) => {
51
- console.log('json.stringify(arr) then', res.length, res.substr(0, 200) + '...')
51
+ console.log('json.stringify(arr) then', res.length, res.slice(0, 200) + '...')
52
52
  })
53
53
  .catch((err) => {
54
54
  console.log('json.stringify(arr) catch', err)
@@ -64,4 +64,4 @@ testLarge()
64
64
  })
65
65
 
66
66
 
67
- //node --experimental-modules --es-module-specifier-resolution=node g-large.mjs
67
+ //node g-large.mjs
@@ -71,4 +71,4 @@ testSmallStream()
71
71
  })
72
72
 
73
73
 
74
- //node --experimental-modules --es-module-specifier-resolution=node g-small-stream.mjs
74
+ //node g-small-stream.mjs
package/g-small.mjs CHANGED
@@ -71,4 +71,4 @@ testSmall()
71
71
  })
72
72
 
73
73
 
74
- //node --experimental-modules --es-module-specifier-resolution=node g-small.mjs
74
+ //node g-small.mjs
package/g-stream.mjs CHANGED
@@ -58,7 +58,7 @@ async function testStream() {
58
58
  let res = fs.readFileSync(fp, 'utf8')
59
59
  fs.unlinkSync(fp)
60
60
  console.log('res.length', res.length)
61
- console.log('res', res.substr(0, 200) + '...')
61
+ console.log('res', res.slice(0, 200) + '...')
62
62
  resolve()
63
63
  })
64
64
 
@@ -274,4 +274,4 @@ testStream()
274
274
  })
275
275
 
276
276
 
277
- //node --experimental-modules --es-module-specifier-resolution=node g-stream.mjs
277
+ //node g-stream.mjs
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "w-json-stream",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "main": "dist/w-json-stream.umd.js",
5
5
  "dependencies": {
6
6
  "jsonparse": "^1.3.1",
7
- "lodash-es": "^4.17.21",
8
- "wsemi": "^1.7.49"
7
+ "lodash-es": "^4.18.1",
8
+ "wsemi": "^1.8.67"
9
9
  },
10
10
  "devDependencies": {
11
- "w-package-tools": "^1.0.75"
11
+ "w-package-tools": "^1.1.12"
12
12
  },
13
13
  "scripts": {
14
- "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
14
+ "test": "mocha --parallel --timeout 60000",
15
15
  "deploy": "gh-pages -d docs"
16
16
  },
17
17
  "repository": {
package/script.txt CHANGED
@@ -1,12 +1,12 @@
1
- #node --experimental-modules --es-module-specifier-resolution=node toolg/addVersion.mjs
2
- node --experimental-modules --es-module-specifier-resolution=node toolg/modifyReadme.mjs
1
+ #node toolg/addVersion.mjs
2
+ node toolg/modifyReadme.mjs
3
3
 
4
- node --experimental-modules --es-module-specifier-resolution=node toolg/cleanFolder.mjs
4
+ node toolg/cleanFolder.mjs
5
5
  ./node_modules/.bin/jsdoc -c .jsdoc
6
6
 
7
- node --experimental-modules --es-module-specifier-resolution=node toolg/gDocsExams.mjs
7
+ node toolg/gDocsExams.mjs
8
8
 
9
- node --experimental-modules --es-module-specifier-resolution=node toolg/gDistRollup.mjs
9
+ node toolg/gDistRollup.mjs
10
10
 
11
11
  git add . -A
12
12
  git commit -m 'modify: '
@@ -1,7 +1,7 @@
1
- //fork from: https://github.com/dominictarr/through/blob/master/index.js
1
+ //fork from: https://github.com/dominictarr/JSONStream/blob/master/index.js
2
2
  import Parser from 'jsonparse'
3
3
  import { Buffer } from 'buffer'
4
- import through from './through.mjs'
4
+ import through from './through.mjs' //統一使用stream, 並改寫為es6, 避免重複減少打包體積
5
5
 
6
6
 
7
7
  // let bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from
@@ -1,6 +1,6 @@
1
1
  //fork from: https://github.com/sindresorhus/into-stream/blob/main/index.js
2
2
  // import from2 from 'from2'
3
- import from2 from './from2.mjs'
3
+ import from2 from './from2.mjs' //將readable-stream改為stream, 避免重複減少打包體積
4
4
  import { Buffer } from 'buffer'
5
5
  import { setImmediate } from 'timers'
6
6
  import isPromise from 'wsemi/src/ispm.mjs'
@@ -55,8 +55,8 @@ describe(`createStringifyStream`, function() {
55
55
  console.log('writerStream finish')
56
56
  let res = fs.readFileSync(fp, 'utf8')
57
57
  fs.unlinkSync(fp)
58
- // console.log(res.length, res.substr(0, 200) + '...')
59
- res = res.substr(0, 200) + '...'
58
+ // console.log(res.length, res.slice(0, 200) + '...')
59
+ res = res.slice(0, 200) + '...'
60
60
  pm.resolve(res)
61
61
  })
62
62