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.
@@ -9,12 +9,12 @@ jobs:
9
9
 
10
10
  strategy:
11
11
  matrix:
12
- node-version: [18.x]
12
+ node-version: [24.x]
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v4
16
16
  - name: Use Node.js ${{ matrix.node-version }}
17
- uses: actions/setup-node@v1
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
  ![language](https://img.shields.io/badge/language-JavaScript-orange.svg)
5
5
  [![npm version](http://img.shields.io/npm/v/w-json-stream.svg?style=flat)](https://npmjs.org/package/w-json-stream)
6
6
  [![license](https://img.shields.io/npm/l/w-json-stream.svg?style=flat)](https://npmjs.org/package/w-json-stream)
7
- [![gzip file size](http://img.badgesize.io/yuda-lyu/w-json-stream/master/dist/w-json-stream.umd.js.svg?compression=gzip)](https://github.com/yuda-lyu/w-json-stream)
8
7
  [![npm download](https://img.shields.io/npm/dt/w-json-stream.svg)](https://npmjs.org/package/w-json-stream)
9
8
  [![npm download](https://img.shields.io/npm/dm/w-json-stream.svg)](https://npmjs.org/package/w-json-stream)
10
9
  [![jsdelivr download](https://img.shields.io/jsdelivr/npm/hm/w-json-stream.svg)](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.substr(0, 200) + '...')
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.substr(0, 200) + '...')
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.substr(0, 200) + '...')
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
- [Necessary] Add script for w-json-stream.
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.20/dist/w-json-stream.umd.js"></script>
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.20/dist/w-json-stream.wk.umd.js"></script>
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-proposal-nullish-coalescing-operator',
13
- '@babel/plugin-proposal-optional-chaining'
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
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * into-stream v1.0.20
2
+ * into-stream v1.0.22
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json-stream-stringify v1.0.20
2
+ * json-stream-stringify v1.0.22
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * through v1.0.20
2
+ * through v1.0.22
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-json-stream v1.0.20
2
+ * w-json-stream v1.0.22
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */