w-json-stream 1.0.20 → 1.0.22
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 +3 -3
- 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 +4 -4
- package/script.txt +20 -0
- package/src/JSONStream.mjs +2 -2
- package/src/WJsonStream.mjs +2 -2
- package/src/intoStream.mjs +1 -1
- package/test/createStringifyStream.test.mjs +2 -2
|
@@ -9,12 +9,12 @@ jobs:
|
|
|
9
9
|
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
|
-
node-version: [
|
|
12
|
+
node-version: [24.x]
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
16
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
17
|
-
uses: actions/setup-node@
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
18
|
with:
|
|
19
19
|
node-version: ${{ matrix.node-version }}
|
|
20
20
|
- run: npm cache clean -f
|
package/LICENSE
CHANGED
|
@@ -12,6 +12,14 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
+
This project also incorporates code from the following upstream open-source projects, each licensed under the MIT License:
|
|
16
|
+
|
|
17
|
+
- [into-stream](https://github.com/sindresorhus/into-stream) by sindresorhus
|
|
18
|
+
- [from2](https://github.com/hughsk/from2) by hughsk
|
|
19
|
+
- [JSONStream](https://github.com/dominictarr/JSONStream) by dominictarr
|
|
20
|
+
- [through](https://github.com/dominictarr/through) by dominictarr
|
|
21
|
+
- [json-stream-stringify](https://github.com/Faleij/json-stream-stringify) by Faleij
|
|
22
|
+
|
|
15
23
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
24
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
25
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
package/README.md
CHANGED
|
@@ -4,17 +4,30 @@ A tool for JSON parse and stringify by stream and web worker.
|
|
|
4
4
|

|
|
5
5
|
[](https://npmjs.org/package/w-json-stream)
|
|
6
6
|
[](https://npmjs.org/package/w-json-stream)
|
|
7
|
-
[](https://github.com/yuda-lyu/w-json-stream)
|
|
8
7
|
[](https://npmjs.org/package/w-json-stream)
|
|
9
8
|
[](https://npmjs.org/package/w-json-stream)
|
|
10
9
|
[](https://www.jsdelivr.com/package/npm/w-json-stream)
|
|
11
10
|
|
|
11
|
+
## Statement
|
|
12
|
+
|
|
13
|
+
This project is based on modifications and integrations of the following open-source projects:
|
|
14
|
+
|
|
15
|
+
- Forked from [into-stream](https://github.com/sindresorhus/into-stream) by sindresorhus
|
|
16
|
+
- Forked from [from2](https://github.com/hughsk/from2) by hughsk
|
|
17
|
+
- Forked from [JSONStream](https://github.com/dominictarr/JSONStream) by dominictarr
|
|
18
|
+
- Forked from [through](https://github.com/dominictarr/through) by dominictarr
|
|
19
|
+
- Forked from [json-stream-stringify](https://github.com/Faleij/json-stream-stringify) by Faleij
|
|
20
|
+
|
|
21
|
+
The original projects are licensed under the MIT License, and this project is also distributed under the MIT License.
|
|
22
|
+
|
|
23
|
+
Special thanks to the original authors for their outstanding contributions — without their work, this project would not exist. 🙏
|
|
24
|
+
|
|
12
25
|
## Documentation
|
|
13
26
|
To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-json-stream/global.html).
|
|
14
27
|
|
|
15
28
|
## Installation
|
|
29
|
+
|
|
16
30
|
### Using npm(ES6 module):
|
|
17
|
-
> **Note:** w-json-stream is mainly dependent on `from2` and `jsonparse`.
|
|
18
31
|
```alias
|
|
19
32
|
npm i w-json-stream
|
|
20
33
|
```
|
|
@@ -129,7 +142,7 @@ async function testLarge() {
|
|
|
129
142
|
|
|
130
143
|
try {
|
|
131
144
|
let res = JSON.stringify(lgArr)
|
|
132
|
-
console.log('JSON.stringify(lgArr)', res.length, res.
|
|
145
|
+
console.log('JSON.stringify(lgArr)', res.length, res.slice(0, 200) + '...')
|
|
133
146
|
}
|
|
134
147
|
catch (err) {
|
|
135
148
|
console.log('JSON.stringify(lgArr) catch', err)
|
|
@@ -143,7 +156,7 @@ async function testLarge() {
|
|
|
143
156
|
|
|
144
157
|
await json.stringify(lgArr)
|
|
145
158
|
.then((res) => {
|
|
146
|
-
console.log('json.stringify(lgArr) then', res.length, res.
|
|
159
|
+
console.log('json.stringify(lgArr) then', res.length, res.slice(0, 200) + '...')
|
|
147
160
|
})
|
|
148
161
|
.catch((err) => {
|
|
149
162
|
console.log('json.stringify(lgArr) catch', err)
|
|
@@ -219,7 +232,7 @@ async function testStream() {
|
|
|
219
232
|
let res = fs.readFileSync(fp, 'utf8')
|
|
220
233
|
fs.unlinkSync(fp)
|
|
221
234
|
console.log('res.length', res.length)
|
|
222
|
-
console.log('res', res.
|
|
235
|
+
console.log('res', res.slice(0, 200) + '...')
|
|
223
236
|
resolve()
|
|
224
237
|
})
|
|
225
238
|
|
|
@@ -437,16 +450,15 @@ testStream()
|
|
|
437
450
|
```
|
|
438
451
|
|
|
439
452
|
### In a browser(UMD module):
|
|
440
|
-
> **Note:** w-json-stream does not dependent on any package.
|
|
441
453
|
|
|
442
|
-
|
|
454
|
+
Add script for w-json-stream.
|
|
443
455
|
```alias
|
|
444
456
|
|
|
445
457
|
<!-- for basic -->
|
|
446
|
-
<script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
458
|
+
<script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.22/dist/w-json-stream.umd.js"></script>
|
|
447
459
|
|
|
448
460
|
<!-- for web workers -->
|
|
449
|
-
<script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.
|
|
461
|
+
<script src="https://cdn.jsdelivr.net/npm/w-json-stream@1.0.22/dist/w-json-stream.wk.umd.js"></script>
|
|
450
462
|
|
|
451
463
|
```
|
|
452
464
|
|
package/babel.config.js
CHANGED
|
@@ -7,9 +7,10 @@ module.exports = {
|
|
|
7
7
|
],
|
|
8
8
|
'plugins': [
|
|
9
9
|
'@babel/plugin-transform-runtime',
|
|
10
|
-
'@babel/plugin-syntax-import-assertions',
|
|
11
10
|
'@babel/plugin-proposal-export-default-from',
|
|
12
|
-
'@babel/plugin-
|
|
13
|
-
'@babel/plugin-proposal-
|
|
11
|
+
// '@babel/plugin-syntax-import-assertions', //已被棄用
|
|
12
|
+
// '@babel/plugin-proposal-nullish-coalescing-operator', //browser與nodejs已支援
|
|
13
|
+
// '@babel/plugin-proposal-object-rest-spread', //browser與nodejs已支援
|
|
14
|
+
// '@babel/plugin-proposal-optional-chaining', //browser與nodejs已支援
|
|
14
15
|
]
|
|
15
16
|
}
|
package/dist/into-stream.umd.js
CHANGED
package/dist/through.umd.js
CHANGED