@naturalcycles/nodejs-lib 13.20.0 → 13.21.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.
- package/dist/csv/transformToCSV.js +1 -0
- package/dist/stream/ndjson/transformJsonParse.js +3 -0
- package/dist/stream/ndjson/transformToNDJson.js +1 -0
- package/dist/stream/transform/transformSplit.js +3 -0
- package/package.json +1 -1
- package/src/csv/transformToCSV.ts +1 -0
- package/src/stream/ndjson/transformJsonParse.ts +3 -0
- package/src/stream/ndjson/transformToNDJson.ts +1 -0
- package/src/stream/transform/transformSplit.ts +3 -0
|
@@ -21,6 +21,9 @@ function transformJsonParse(opt = {}) {
|
|
|
21
21
|
return new node_stream_1.Transform({
|
|
22
22
|
writableObjectMode: false,
|
|
23
23
|
readableObjectMode: true,
|
|
24
|
+
// highWatermark increased, because it's proven to be faster: https://github.com/nodejs/node/pull/52037
|
|
25
|
+
// todo: it'll be default in Node 22, then we can remove this
|
|
26
|
+
writableHighWaterMark: 64 * 1024,
|
|
24
27
|
transform(chunk, _, cb) {
|
|
25
28
|
try {
|
|
26
29
|
const data = JSON.parse(chunk, reviver);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformSplit = void 0;
|
|
4
|
+
// https://github.com/max-mapper/binary-split
|
|
5
|
+
// todo: test its newer version that doesn't have `through2` dependency
|
|
6
|
+
// todo: test writableHighWaterMark of 64k
|
|
4
7
|
const _binarySplit = require('binary-split');
|
|
5
8
|
/**
|
|
6
9
|
* Input: stream (objectMode=false) of arbitrary string|Buffer chunks, like when read from fs
|
package/package.json
CHANGED
|
@@ -35,6 +35,9 @@ export function transformJsonParse<OUT = any>(
|
|
|
35
35
|
return new Transform({
|
|
36
36
|
writableObjectMode: false,
|
|
37
37
|
readableObjectMode: true,
|
|
38
|
+
// highWatermark increased, because it's proven to be faster: https://github.com/nodejs/node/pull/52037
|
|
39
|
+
// todo: it'll be default in Node 22, then we can remove this
|
|
40
|
+
writableHighWaterMark: 64 * 1024,
|
|
38
41
|
transform(chunk: string, _, cb) {
|
|
39
42
|
try {
|
|
40
43
|
const data = JSON.parse(chunk, reviver)
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TransformTyped } from '../stream.model'
|
|
2
2
|
|
|
3
|
+
// https://github.com/max-mapper/binary-split
|
|
4
|
+
// todo: test its newer version that doesn't have `through2` dependency
|
|
5
|
+
// todo: test writableHighWaterMark of 64k
|
|
3
6
|
const _binarySplit = require('binary-split')
|
|
4
7
|
|
|
5
8
|
/**
|