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.
- package/.github/workflows/ci-test.yml +3 -3
- package/LICENSE +8 -0
- package/README.md +21 -9
- package/babel.config.js +4 -3
- package/dist/into-stream.umd.js +1 -1
- package/dist/json-stream-stringify.umd.js +1 -1
- package/dist/through.umd.js +1 -1
- package/dist/w-json-stream.umd.js +1 -1
- package/dist/w-json-stream.umd.js.map +1 -1
- package/dist/w-json-stream.wk.umd.js +1 -1
- package/docs/WJsonStream.mjs.html +1 -1
- package/docs/examples/ex-large-webworker.html +2 -2
- package/docs/examples/ex-large.html +2 -2
- package/docs/examples/ex-small-stream.html +2 -2
- package/docs/examples/ex-small.html +2 -2
- package/docs/examples/ex-stream-createParseStream.html +3 -3
- package/docs/examples/ex-stream-createParseStreamWithFilter.html +4 -4
- package/docs/examples/ex-stream-createStringifyStream.html +2 -2
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/examples/ex-stream-createParseStream.html +1 -1
- package/examples/ex-stream-createParseStreamWithFilter.html +1 -1
- package/g-large.mjs +3 -3
- package/g-small-stream.mjs +1 -1
- package/g-small.mjs +1 -1
- package/g-stream.mjs +2 -2
- package/package.json +5 -5
- package/script.txt +5 -5
- package/src/JSONStream.mjs +2 -2
- package/src/intoStream.mjs +1 -1
- package/test/createStringifyStream.test.mjs +2 -2
|
@@ -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.
|
|
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.
|
|
14
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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.
|
|
14
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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.
|
|
14
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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.
|
|
14
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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.
|
|
14
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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
|
|
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
|
|
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.
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
17
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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.
|
|
14
|
-
<script msg="封裝woker無法使用createStringifyStream回傳為stream對象" _src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
67
|
+
//node g-large.mjs
|
package/g-small-stream.mjs
CHANGED
package/g-small.mjs
CHANGED
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.
|
|
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
|
|
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.
|
|
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.
|
|
8
|
-
"wsemi": "^1.
|
|
7
|
+
"lodash-es": "^4.18.1",
|
|
8
|
+
"wsemi": "^1.8.67"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"w-package-tools": "^1.
|
|
11
|
+
"w-package-tools": "^1.1.12"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"test": "mocha --parallel --timeout 60000
|
|
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
|
|
2
|
-
node
|
|
1
|
+
#node toolg/addVersion.mjs
|
|
2
|
+
node toolg/modifyReadme.mjs
|
|
3
3
|
|
|
4
|
-
node
|
|
4
|
+
node toolg/cleanFolder.mjs
|
|
5
5
|
./node_modules/.bin/jsdoc -c .jsdoc
|
|
6
6
|
|
|
7
|
-
node
|
|
7
|
+
node toolg/gDocsExams.mjs
|
|
8
8
|
|
|
9
|
-
node
|
|
9
|
+
node toolg/gDistRollup.mjs
|
|
10
10
|
|
|
11
11
|
git add . -A
|
|
12
12
|
git commit -m 'modify: '
|
package/src/JSONStream.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//fork from: https://github.com/dominictarr/
|
|
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
|
package/src/intoStream.mjs
CHANGED
|
@@ -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.
|
|
59
|
-
res = res.
|
|
58
|
+
// console.log(res.length, res.slice(0, 200) + '...')
|
|
59
|
+
res = res.slice(0, 200) + '...'
|
|
60
60
|
pm.resolve(res)
|
|
61
61
|
})
|
|
62
62
|
|