jtcsv 3.0.0 → 3.1.1
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/README.md +205 -146
- package/bin/jtcsv.ts +280 -202
- package/browser.d.ts +142 -0
- package/dist/benchmark.js +446 -0
- package/dist/benchmark.js.map +1 -0
- package/dist/bin/jtcsv.js +1940 -0
- package/dist/bin/jtcsv.js.map +1 -0
- package/dist/csv-to-json.js +1261 -0
- package/dist/csv-to-json.js.map +1 -0
- package/dist/errors.js +291 -0
- package/dist/errors.js.map +1 -0
- package/dist/eslint.config.js +147 -0
- package/dist/eslint.config.js.map +1 -0
- package/dist/index-core.js +95 -0
- package/dist/index-core.js.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/json-save.js +229 -0
- package/dist/json-save.js.map +1 -0
- package/dist/json-to-csv.js +576 -0
- package/dist/json-to-csv.js.map +1 -0
- package/dist/jtcsv-core.cjs.js +336 -7
- package/dist/jtcsv-core.cjs.js.map +1 -1
- package/dist/jtcsv-core.esm.js +336 -7
- package/dist/jtcsv-core.esm.js.map +1 -1
- package/dist/jtcsv-core.umd.js +336 -7
- package/dist/jtcsv-core.umd.js.map +1 -1
- package/dist/jtcsv-full.cjs.js +336 -7
- package/dist/jtcsv-full.cjs.js.map +1 -1
- package/dist/jtcsv-full.esm.js +336 -7
- package/dist/jtcsv-full.esm.js.map +1 -1
- package/dist/jtcsv-full.umd.js +336 -7
- package/dist/jtcsv-full.umd.js.map +1 -1
- package/dist/jtcsv-workers.esm.js +9 -0
- package/dist/jtcsv-workers.esm.js.map +1 -1
- package/dist/jtcsv-workers.umd.js +9 -0
- package/dist/jtcsv-workers.umd.js.map +1 -1
- package/dist/jtcsv.cjs.js +1998 -2092
- package/dist/jtcsv.cjs.js.map +1 -1
- package/dist/jtcsv.esm.js +1994 -2092
- package/dist/jtcsv.esm.js.map +1 -1
- package/dist/jtcsv.umd.js +2157 -2251
- package/dist/jtcsv.umd.js.map +1 -1
- package/dist/plugins/express-middleware/index.js +350 -0
- package/dist/plugins/express-middleware/index.js.map +1 -0
- package/dist/plugins/fastify-plugin/index.js +315 -0
- package/dist/plugins/fastify-plugin/index.js.map +1 -0
- package/dist/plugins/hono/index.js +111 -0
- package/dist/plugins/hono/index.js.map +1 -0
- package/dist/plugins/nestjs/index.js +192 -0
- package/dist/plugins/nestjs/index.js.map +1 -0
- package/dist/plugins/nuxt/index.js +53 -0
- package/dist/plugins/nuxt/index.js.map +1 -0
- package/dist/plugins/remix/index.js +133 -0
- package/dist/plugins/remix/index.js.map +1 -0
- package/dist/plugins/sveltekit/index.js +155 -0
- package/dist/plugins/sveltekit/index.js.map +1 -0
- package/dist/plugins/trpc/index.js +136 -0
- package/dist/plugins/trpc/index.js.map +1 -0
- package/dist/run-demo.js +49 -0
- package/dist/run-demo.js.map +1 -0
- package/dist/src/browser/browser-functions.js +193 -0
- package/dist/src/browser/browser-functions.js.map +1 -0
- package/dist/src/browser/core.js +123 -0
- package/dist/src/browser/core.js.map +1 -0
- package/dist/src/browser/csv-to-json-browser.js +353 -0
- package/dist/src/browser/csv-to-json-browser.js.map +1 -0
- package/dist/src/browser/errors-browser.js +219 -0
- package/dist/src/browser/errors-browser.js.map +1 -0
- package/dist/src/browser/extensions/plugins.js +106 -0
- package/dist/src/browser/extensions/plugins.js.map +1 -0
- package/dist/src/browser/extensions/workers.js +66 -0
- package/dist/src/browser/extensions/workers.js.map +1 -0
- package/dist/src/browser/index.js +140 -0
- package/dist/src/browser/index.js.map +1 -0
- package/dist/src/browser/json-to-csv-browser.js +225 -0
- package/dist/src/browser/json-to-csv-browser.js.map +1 -0
- package/dist/src/browser/streams.js +340 -0
- package/dist/src/browser/streams.js.map +1 -0
- package/dist/src/browser/workers/csv-parser.worker.js +264 -0
- package/dist/src/browser/workers/csv-parser.worker.js.map +1 -0
- package/dist/src/browser/workers/worker-pool.js +338 -0
- package/dist/src/browser/workers/worker-pool.js.map +1 -0
- package/dist/src/core/delimiter-cache.js +196 -0
- package/dist/src/core/delimiter-cache.js.map +1 -0
- package/dist/src/core/node-optimizations.js +279 -0
- package/dist/src/core/node-optimizations.js.map +1 -0
- package/dist/src/core/plugin-system.js +399 -0
- package/dist/src/core/plugin-system.js.map +1 -0
- package/dist/src/core/transform-hooks.js +348 -0
- package/dist/src/core/transform-hooks.js.map +1 -0
- package/dist/src/engines/fast-path-engine-new.js +262 -0
- package/dist/src/engines/fast-path-engine-new.js.map +1 -0
- package/dist/src/engines/fast-path-engine.js +671 -0
- package/dist/src/engines/fast-path-engine.js.map +1 -0
- package/dist/src/errors.js +18 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/formats/ndjson-parser.js +332 -0
- package/dist/src/formats/ndjson-parser.js.map +1 -0
- package/dist/src/formats/tsv-parser.js +230 -0
- package/dist/src/formats/tsv-parser.js.map +1 -0
- package/dist/src/index-with-plugins.js +259 -0
- package/dist/src/index-with-plugins.js.map +1 -0
- package/dist/src/types/index.js +3 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utils/bom-utils.js +267 -0
- package/dist/src/utils/bom-utils.js.map +1 -0
- package/dist/src/utils/encoding-support.js +77 -0
- package/dist/src/utils/encoding-support.js.map +1 -0
- package/dist/src/utils/schema-validator.js +609 -0
- package/dist/src/utils/schema-validator.js.map +1 -0
- package/dist/src/utils/transform-loader.js +281 -0
- package/dist/src/utils/transform-loader.js.map +1 -0
- package/dist/src/utils/validators.js +40 -0
- package/dist/src/utils/validators.js.map +1 -0
- package/dist/src/utils/zod-adapter.js +144 -0
- package/dist/src/utils/zod-adapter.js.map +1 -0
- package/{src → dist/src}/web-server/index.js +251 -286
- package/dist/src/web-server/index.js.map +1 -0
- package/dist/src/workers/csv-multithreaded.js +211 -0
- package/dist/src/workers/csv-multithreaded.js.map +1 -0
- package/dist/src/workers/csv-parser.worker.js +179 -0
- package/dist/src/workers/csv-parser.worker.js.map +1 -0
- package/dist/src/workers/worker-pool.js +228 -0
- package/dist/src/workers/worker-pool.js.map +1 -0
- package/dist/stream-csv-to-json.js +664 -0
- package/dist/stream-csv-to-json.js.map +1 -0
- package/dist/stream-json-to-csv.js +389 -0
- package/dist/stream-json-to-csv.js.map +1 -0
- package/examples/advanced/conditional-transformations.ts +2 -2
- package/examples/advanced/performance-optimization.ts +2 -2
- package/examples/cli-advanced-usage.md +2 -0
- package/examples/cli-tool.ts +1 -1
- package/examples/large-dataset-example.ts +2 -2
- package/examples/simple-usage.ts +2 -2
- package/examples/streaming-example.ts +1 -1
- package/index.d.ts +186 -15
- package/package.json +243 -305
- package/plugins.d.ts +37 -0
- package/schema.d.ts +103 -0
- package/src/browser/csv-to-json-browser.ts +233 -3
- package/src/browser/errors-browser.ts +45 -28
- package/src/browser/json-to-csv-browser.ts +81 -5
- package/src/browser/streams.ts +73 -6
- package/src/core/delimiter-cache.ts +21 -11
- package/src/core/plugin-system.ts +343 -155
- package/src/core/transform-hooks.ts +20 -12
- package/src/engines/fast-path-engine.ts +48 -32
- package/src/errors.ts +1 -72
- package/src/formats/ndjson-parser.ts +6 -0
- package/src/formats/tsv-parser.ts +6 -0
- package/src/types/index.ts +21 -1
- package/src/utils/validators.ts +35 -0
- package/src/web-server/index.ts +1 -1
- package/bin/jtcsv.js +0 -2532
- package/csv-to-json.js +0 -711
- package/errors.js +0 -394
- package/examples/advanced/conditional-transformations.js +0 -446
- package/examples/advanced/csv-parser.worker.js +0 -89
- package/examples/advanced/nested-objects-example.js +0 -306
- package/examples/advanced/performance-optimization.js +0 -504
- package/examples/advanced/run-demo-server.js +0 -116
- package/examples/cli-batch-processing.js +0 -38
- package/examples/cli-tool.js +0 -183
- package/examples/error-handling.js +0 -338
- package/examples/express-api.js +0 -164
- package/examples/large-dataset-example.js +0 -182
- package/examples/ndjson-processing.js +0 -434
- package/examples/plugin-excel-exporter.js +0 -406
- package/examples/schema-validation.js +0 -640
- package/examples/simple-usage.js +0 -282
- package/examples/streaming-example.js +0 -418
- package/examples/web-workers-advanced.js +0 -28
- package/index.js +0 -82
- package/json-save.js +0 -255
- package/json-to-csv.js +0 -668
- package/plugins/README.md +0 -91
- package/plugins/express-middleware/README.md +0 -83
- package/plugins/express-middleware/example.js +0 -135
- package/plugins/express-middleware/example.ts +0 -135
- package/plugins/express-middleware/index.d.ts +0 -114
- package/plugins/express-middleware/index.js +0 -512
- package/plugins/express-middleware/index.ts +0 -557
- package/plugins/express-middleware/package.json +0 -52
- package/plugins/fastify-plugin/index.js +0 -404
- package/plugins/fastify-plugin/index.ts +0 -443
- package/plugins/fastify-plugin/package.json +0 -55
- package/plugins/hono/README.md +0 -28
- package/plugins/hono/index.d.ts +0 -12
- package/plugins/hono/index.js +0 -36
- package/plugins/hono/index.ts +0 -226
- package/plugins/hono/package.json +0 -35
- package/plugins/nestjs/README.md +0 -35
- package/plugins/nestjs/index.d.ts +0 -25
- package/plugins/nestjs/index.js +0 -77
- package/plugins/nestjs/index.ts +0 -201
- package/plugins/nestjs/package.json +0 -37
- package/plugins/nextjs-api/README.md +0 -57
- package/plugins/nextjs-api/examples/ConverterComponent.jsx +0 -386
- package/plugins/nextjs-api/examples/ConverterComponent.tsx +0 -386
- package/plugins/nextjs-api/examples/api-convert.js +0 -67
- package/plugins/nextjs-api/examples/api-convert.ts +0 -67
- package/plugins/nextjs-api/index.js +0 -387
- package/plugins/nextjs-api/index.tsx +0 -339
- package/plugins/nextjs-api/package.json +0 -63
- package/plugins/nextjs-api/route.js +0 -370
- package/plugins/nextjs-api/route.ts +0 -370
- package/plugins/nuxt/README.md +0 -24
- package/plugins/nuxt/index.js +0 -21
- package/plugins/nuxt/index.ts +0 -94
- package/plugins/nuxt/package.json +0 -35
- package/plugins/nuxt/runtime/composables/useJtcsv.js +0 -6
- package/plugins/nuxt/runtime/composables/useJtcsv.ts +0 -100
- package/plugins/nuxt/runtime/plugin.js +0 -6
- package/plugins/nuxt/runtime/plugin.ts +0 -71
- package/plugins/remix/README.md +0 -26
- package/plugins/remix/index.d.ts +0 -16
- package/plugins/remix/index.js +0 -62
- package/plugins/remix/index.ts +0 -260
- package/plugins/remix/package.json +0 -35
- package/plugins/sveltekit/README.md +0 -28
- package/plugins/sveltekit/index.d.ts +0 -17
- package/plugins/sveltekit/index.js +0 -54
- package/plugins/sveltekit/index.ts +0 -301
- package/plugins/sveltekit/package.json +0 -33
- package/plugins/trpc/README.md +0 -25
- package/plugins/trpc/index.d.ts +0 -7
- package/plugins/trpc/index.js +0 -32
- package/plugins/trpc/index.ts +0 -267
- package/plugins/trpc/package.json +0 -34
- package/src/browser/browser-functions.js +0 -219
- package/src/browser/core.js +0 -92
- package/src/browser/csv-to-json-browser.js +0 -722
- package/src/browser/errors-browser.js +0 -212
- package/src/browser/extensions/plugins.js +0 -92
- package/src/browser/extensions/workers.js +0 -39
- package/src/browser/index.js +0 -113
- package/src/browser/json-to-csv-browser.js +0 -319
- package/src/browser/streams.js +0 -403
- package/src/browser/workers/csv-parser.worker.js +0 -377
- package/src/browser/workers/worker-pool.js +0 -527
- package/src/core/delimiter-cache.js +0 -200
- package/src/core/node-optimizations.js +0 -408
- package/src/core/plugin-system.js +0 -494
- package/src/core/transform-hooks.js +0 -350
- package/src/engines/fast-path-engine-new.js +0 -338
- package/src/engines/fast-path-engine.js +0 -844
- package/src/errors.js +0 -26
- package/src/formats/ndjson-parser.js +0 -467
- package/src/formats/tsv-parser.js +0 -339
- package/src/index-with-plugins.js +0 -378
- package/src/utils/bom-utils.js +0 -259
- package/src/utils/encoding-support.js +0 -124
- package/src/utils/schema-validator.js +0 -594
- package/src/utils/transform-loader.js +0 -205
- package/src/utils/zod-adapter.js +0 -170
- package/stream-csv-to-json.js +0 -560
- package/stream-json-to-csv.js +0 -465
package/package.json
CHANGED
|
@@ -1,307 +1,245 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jtcsv",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Complete JSON<->CSV and CSV<->JSON converter for Node.js and Browser with streaming, security, Web Workers, TypeScript support, and optional ecosystem (zero-deps core)",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"browser": "dist/jtcsv.umd.js",
|
|
7
|
-
"module": "dist/jtcsv.esm.js",
|
|
8
|
-
"types": "index.d.ts",
|
|
9
|
-
"bin": {
|
|
10
|
-
"jtcsv": "bin/jtcsv.js"
|
|
11
|
-
},
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"require": "./index.js",
|
|
15
|
-
"import": "./dist/jtcsv.esm.js",
|
|
16
|
-
"browser": "./dist/jtcsv.umd.js",
|
|
17
|
-
"default": "./index.js"
|
|
18
|
-
},
|
|
19
|
-
"./browser": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
"import": "./plugins/hono/index.js",
|
|
73
|
-
"default": "./plugins/hono/index.js"
|
|
74
|
-
},
|
|
75
|
-
"./trpc": {
|
|
76
|
-
"require": "./plugins/trpc/index.js",
|
|
77
|
-
"import": "./plugins/trpc/index.js",
|
|
78
|
-
"default": "./plugins/trpc/index.js"
|
|
79
|
-
},
|
|
80
|
-
"./core": {
|
|
81
|
-
"require": "./dist/jtcsv-core.cjs.js",
|
|
82
|
-
"import": "./dist/jtcsv-core.esm.js",
|
|
83
|
-
"browser": "./dist/jtcsv-core.umd.js",
|
|
84
|
-
"default": "./dist/jtcsv-core.cjs.js"
|
|
85
|
-
},
|
|
86
|
-
"./full": {
|
|
87
|
-
"require": "./dist/jtcsv-full.cjs.js",
|
|
88
|
-
"import": "./dist/jtcsv-full.esm.js",
|
|
89
|
-
"browser": "./dist/jtcsv-full.umd.js",
|
|
90
|
-
"default": "./dist/jtcsv-full.cjs.js"
|
|
91
|
-
},
|
|
92
|
-
"./workers": {
|
|
93
|
-
"require": "./dist/jtcsv-workers.cjs.js",
|
|
94
|
-
"import": "./dist/jtcsv-workers.esm.js",
|
|
95
|
-
"browser": "./dist/jtcsv-workers.umd.js",
|
|
96
|
-
"default": "./dist/jtcsv-workers.esm.js"
|
|
97
|
-
},
|
|
98
|
-
"./optimized": {
|
|
99
|
-
"require": "./dist/jtcsv-core.cjs.js",
|
|
100
|
-
"import": "./dist/jtcsv-core.esm.js",
|
|
101
|
-
"browser": "./dist/jtcsv-core.umd.js",
|
|
102
|
-
"default": "./dist/jtcsv-core.cjs.js"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"scripts": {
|
|
106
|
-
"test": "jest",
|
|
107
|
-
"test:unit": "jest --testPathIgnorePatterns=\"(__tests__/benchmark-suite.test.js|__tests__/load-tests.test.js|__tests__/soak-memory.test.js|__tests__/security-fuzzing.test.js|__tests__/memory-profiling.test.js)\"",
|
|
108
|
-
"test:coverage": "node scripts/run-coverage.js --target=js --scope=full --strict=0",
|
|
109
|
-
"test:coverage:entry": "node scripts/run-coverage.js --target=js --scope=entry --strict=1",
|
|
110
|
-
"test:coverage:ts": "node scripts/run-coverage.js --target=ts --scope=full --strict=0",
|
|
111
|
-
"test:watch": "jest --watch",
|
|
112
|
-
"test:browser": "jest --testEnvironment=jsdom",
|
|
113
|
-
"test:plugins": "jest __tests__/plugin-system.test.js",
|
|
114
|
-
"test:fastpath": "jest __tests__/fast-path-engine.test.js",
|
|
115
|
-
"test:ndjson": "jest __tests__/ndjson-parser.test.js",
|
|
116
|
-
"test:performance": "jest __tests__/*.test.js --testNamePattern=\"Производительность|производительность\"",
|
|
117
|
-
"test:benchmark": "jest __tests__/benchmark-suite.test.js --testTimeout=60000",
|
|
118
|
-
"test:load": "jest __tests__/load-tests.test.js --testTimeout=300000",
|
|
119
|
-
"test:load:large": "LOAD_TEST_SIZE=large jest __tests__/load-tests.test.js --testTimeout=300000",
|
|
120
|
-
"test:security": "jest __tests__/security-fuzzing.test.js --testTimeout=60000",
|
|
121
|
-
"test:memory": "node --expose-gc node_modules/jest/bin/jest __tests__/memory-profiling.test.js --testTimeout=120000",
|
|
122
|
-
"test:express": "cd plugins/express-middleware && npm test",
|
|
123
|
-
"test:fastify": "cd plugins/fastify-plugin && npm test",
|
|
124
|
-
"test:nextjs": "cd plugins/nextjs-api && npm test",
|
|
125
|
-
"lint": "eslint index.js json-to-csv.js csv-to-json.js errors.js stream-json-to-csv.js stream-csv-to-json.js json-save.js src/browser src/engines src/formats src/core",
|
|
126
|
-
"lint:all": "eslint .",
|
|
127
|
-
"lint:plugins": "eslint plugins/",
|
|
128
|
-
"security-check": "npm audit",
|
|
129
|
-
"prepublishOnly": "npm test && npm run build && eslint index.js json-to-csv.js csv-to-json.js errors.js stream-json-to-csv.js stream-csv-to-json.js json-save.js src/browser src/engines src/formats src/core",
|
|
130
|
-
"tui": "node packages/jtcsv-tui/bin/jtcsv-tui.js",
|
|
131
|
-
"cli": "node bin/jtcsv.js",
|
|
132
|
-
"build": "rollup -c rollup.config.mjs",
|
|
1
|
+
{
|
|
2
|
+
"name": "jtcsv",
|
|
3
|
+
"version": "3.1.1",
|
|
4
|
+
"description": "Complete JSON<->CSV and CSV<->JSON converter for Node.js and Browser with streaming, security, Web Workers, TypeScript support, and optional ecosystem (zero-deps core)",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"browser": "dist/jtcsv.umd.js",
|
|
7
|
+
"module": "dist/jtcsv.esm.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"jtcsv": "dist/bin/jtcsv.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"require": "./dist/index.js",
|
|
15
|
+
"import": "./dist/jtcsv.esm.js",
|
|
16
|
+
"browser": "./dist/jtcsv.umd.js",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./browser": {
|
|
20
|
+
"types": "./browser.d.ts",
|
|
21
|
+
"require": "./dist/jtcsv.cjs.js",
|
|
22
|
+
"import": "./dist/jtcsv.esm.js",
|
|
23
|
+
"browser": "./dist/jtcsv.umd.js",
|
|
24
|
+
"default": "./dist/jtcsv.esm.js"
|
|
25
|
+
},
|
|
26
|
+
"./plugins": {
|
|
27
|
+
"types": "./plugins.d.ts",
|
|
28
|
+
"require": "./dist/src/index-with-plugins.js",
|
|
29
|
+
"import": "./dist/src/index-with-plugins.js",
|
|
30
|
+
"default": "./dist/src/index-with-plugins.js"
|
|
31
|
+
},
|
|
32
|
+
"./cli": {
|
|
33
|
+
"require": "./dist/bin/jtcsv.js",
|
|
34
|
+
"import": "./dist/bin/jtcsv.js",
|
|
35
|
+
"default": "./dist/bin/jtcsv.js"
|
|
36
|
+
},
|
|
37
|
+
"./schema": {
|
|
38
|
+
"types": "./schema.d.ts",
|
|
39
|
+
"require": "./dist/src/utils/schema-validator.js",
|
|
40
|
+
"import": "./dist/src/utils/schema-validator.js",
|
|
41
|
+
"default": "./dist/src/utils/schema-validator.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"test": "jest",
|
|
46
|
+
"test:unit": "jest --testPathIgnorePatterns=\"(__tests__/benchmark-suite.test.js|__tests__/load-tests.test.js|__tests__/soak-memory.test.js|__tests__/security-fuzzing.test.js|__tests__/memory-profiling.test.js)\"",
|
|
47
|
+
"test:coverage": "node scripts/run-coverage.js --target=ts --scope=full --strict=0",
|
|
48
|
+
"test:coverage:entry": "node scripts/run-coverage.js --target=ts --scope=entry --strict=1",
|
|
49
|
+
"test:coverage:ts": "node scripts/run-coverage.js --target=ts --scope=full --strict=0",
|
|
50
|
+
"test:watch": "jest --watch",
|
|
51
|
+
"test:browser": "jest --testEnvironment=jsdom",
|
|
52
|
+
"test:plugins": "jest __tests__/plugin-system.test.js",
|
|
53
|
+
"test:fastpath": "jest __tests__/fast-path-engine.test.js",
|
|
54
|
+
"test:ndjson": "jest __tests__/ndjson-parser.test.js",
|
|
55
|
+
"test:performance": "jest __tests__/*.test.js --testNamePattern=\"Производительность|производительность\"",
|
|
56
|
+
"test:benchmark": "jest __tests__/benchmark-suite.test.js --testTimeout=60000",
|
|
57
|
+
"test:load": "jest __tests__/load-tests.test.js --testTimeout=300000",
|
|
58
|
+
"test:load:large": "cross-env LOAD_TEST_SIZE=large jest __tests__/load-tests.test.js --testTimeout=300000",
|
|
59
|
+
"test:security": "jest __tests__/security-fuzzing.test.js --testTimeout=60000",
|
|
60
|
+
"test:memory": "node --expose-gc node_modules/jest/bin/jest __tests__/memory-profiling.test.js --testTimeout=120000",
|
|
61
|
+
"test:express": "cd plugins/express-middleware && npm test",
|
|
62
|
+
"test:fastify": "cd plugins/fastify-plugin && npm test",
|
|
63
|
+
"test:nextjs": "cd plugins/nextjs-api && npm test",
|
|
64
|
+
"lint": "eslint index.ts json-to-csv.ts csv-to-json.ts errors.ts stream-json-to-csv.ts stream-csv-to-json.ts json-save.ts",
|
|
65
|
+
"lint:all": "eslint .",
|
|
66
|
+
"lint:plugins": "eslint plugins/",
|
|
67
|
+
"security-check": "npm audit",
|
|
68
|
+
"prepublishOnly": "npm test && npm run build && eslint index.ts json-to-csv.ts csv-to-json.ts errors.ts stream-json-to-csv.ts stream-csv-to-json.ts json-save.ts",
|
|
69
|
+
"tui": "node packages/jtcsv-tui/bin/jtcsv-tui.js",
|
|
70
|
+
"cli": "node dist/bin/jtcsv.js",
|
|
71
|
+
"build": "npm run tsc:build && rollup -c rollup.config.mjs",
|
|
133
72
|
"build:watch": "rollup -c rollup.config.mjs -w",
|
|
134
|
-
"build:prod": "NODE_ENV=production rollup -c rollup.config.mjs",
|
|
135
|
-
"dev": "NODE_ENV=development rollup -c rollup.config.mjs -w",
|
|
73
|
+
"build:prod": "npm run tsc:build && cross-env NODE_ENV=production rollup -c rollup.config.mjs",
|
|
74
|
+
"dev": "cross-env NODE_ENV=development rollup -c rollup.config.mjs -w",
|
|
136
75
|
"verify:browser": "node scripts/verify-browser-build.js",
|
|
137
|
-
"demo": "node run-demo.js",
|
|
138
|
-
"demo:web": "cd demo && npm run dev",
|
|
139
|
-
"demo:serve": "cd demo && npm run serve",
|
|
140
|
-
"demo:plugins": "node examples/plugin-excel-exporter.js",
|
|
141
|
-
"demo:express": "cd plugins/express-middleware && node example.js",
|
|
142
|
-
"size": "size-limit",
|
|
143
|
-
"size:why": "size-limit --why",
|
|
144
|
-
"benchmark": "node benchmark.js",
|
|
145
|
-
"benchmark:fastpath": "node benchmark.js --fastpath",
|
|
146
|
-
"profile:perf": "node scripts/profile-performance.js",
|
|
147
|
-
"example:plugins": "node examples/plugin-excel-exporter.js",
|
|
148
|
-
"example:express": "cd plugins/express-middleware && node example.js",
|
|
149
|
-
"plugins:build": "npm run build && cd plugins/express-middleware && npm run build && cd ../fastify-plugin && npm run build && cd ../nextjs-api && npm run build",
|
|
150
|
-
"docs": "typedoc",
|
|
151
|
-
"docs:watch": "typedoc --watch",
|
|
152
|
-
"docs:serve": "typedoc && npx serve docs/api",
|
|
153
|
-
"tsc": "tsc",
|
|
154
|
-
"tsc:dev": "tsc --project tsconfig.dev.json",
|
|
155
|
-
"tsc:build": "tsc --project tsconfig.build.json",
|
|
156
|
-
"tsc:watch": "tsc --project tsconfig.dev.json --watch",
|
|
157
|
-
"tsc:check": "tsc --noEmit",
|
|
158
|
-
"tsc:check-strict": "tsc --noEmit --strict",
|
|
159
|
-
"tsc:types": "tsc --project tsconfig.types.json",
|
|
160
|
-
"test:ts": "jest --config jest.config.ts.js",
|
|
161
|
-
"test:ts:coverage": "jest --config jest.config.ts.js --coverage",
|
|
162
|
-
"test:ts:watch": "jest --config jest.config.ts.js --watch",
|
|
163
|
-
"test:types": "node scripts/run-type-tests.js",
|
|
164
|
-
"build:ts": "npm run
|
|
165
|
-
"build:ts:watch": "npm run tsc:watch & npm run build:watch",
|
|
166
|
-
"lint:ts": "eslint --ext .ts,.tsx .",
|
|
167
|
-
"lint:ts:fix": "eslint --ext .ts,.tsx --fix ."
|
|
168
|
-
},
|
|
169
|
-
"keywords": [
|
|
170
|
-
"json",
|
|
171
|
-
"csv",
|
|
172
|
-
"converter",
|
|
173
|
-
"json-to-csv",
|
|
174
|
-
"csv-to-json",
|
|
175
|
-
"json2csv",
|
|
176
|
-
"csv2json",
|
|
177
|
-
"export",
|
|
178
|
-
"import",
|
|
179
|
-
"excel",
|
|
180
|
-
"data",
|
|
181
|
-
"transform",
|
|
182
|
-
"nodejs",
|
|
183
|
-
"browser",
|
|
184
|
-
"web-workers",
|
|
185
|
-
"streaming",
|
|
186
|
-
"security",
|
|
187
|
-
"csv-injection",
|
|
188
|
-
"javascript",
|
|
189
|
-
"typescript",
|
|
190
|
-
"simple",
|
|
191
|
-
"lightweight",
|
|
192
|
-
"zero-dependencies",
|
|
193
|
-
"utf8",
|
|
194
|
-
"cyrillic",
|
|
195
|
-
"bidirectional",
|
|
196
|
-
"cli",
|
|
197
|
-
"tui",
|
|
198
|
-
"terminal",
|
|
199
|
-
"interface",
|
|
200
|
-
"gui",
|
|
201
|
-
"tool",
|
|
202
|
-
"utility",
|
|
203
|
-
"plugin-system",
|
|
204
|
-
"ndjson",
|
|
205
|
-
"fast-path",
|
|
206
|
-
"optimization",
|
|
207
|
-
"performance",
|
|
208
|
-
"enterprise",
|
|
209
|
-
"express",
|
|
210
|
-
"fastify",
|
|
211
|
-
"nextjs",
|
|
212
|
-
"react",
|
|
213
|
-
"middleware",
|
|
214
|
-
"api",
|
|
215
|
-
"rest",
|
|
216
|
-
"http"
|
|
217
|
-
],
|
|
218
|
-
"author": "Ruslan Fomenko",
|
|
219
|
-
"license": "MIT",
|
|
220
|
-
"repository": {
|
|
221
|
-
"type": "git",
|
|
222
|
-
"url": "git+https://github.com/Linol-Hamelton/jtcsv.git"
|
|
223
|
-
},
|
|
224
|
-
"bugs": {
|
|
225
|
-
"url": "https://github.com/Linol-Hamelton/jtcsv/issues"
|
|
226
|
-
},
|
|
227
|
-
"homepage": "https://github.com/Linol-Hamelton/jtcsv#readme",
|
|
228
|
-
"engines": {
|
|
229
|
-
"node": ">=12.0.0"
|
|
230
|
-
},
|
|
231
|
-
"files": [
|
|
232
|
-
"index.
|
|
233
|
-
"
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
"
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
"@babel/
|
|
251
|
-
"@babel/
|
|
252
|
-
"@
|
|
253
|
-
"@
|
|
254
|
-
"@
|
|
255
|
-
"@
|
|
256
|
-
"@
|
|
257
|
-
"@
|
|
258
|
-
"@
|
|
259
|
-
"@
|
|
260
|
-
"@
|
|
261
|
-
"@
|
|
262
|
-
"@
|
|
263
|
-
"@
|
|
264
|
-
"
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"
|
|
268
|
-
"
|
|
269
|
-
"
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"
|
|
285
|
-
"
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
"
|
|
289
|
-
"
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
"
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"
|
|
304
|
-
"
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
76
|
+
"demo": "npm run build && node dist/run-demo.js",
|
|
77
|
+
"demo:web": "cd demo && npm run dev",
|
|
78
|
+
"demo:serve": "cd demo && npm run serve",
|
|
79
|
+
"demo:plugins": "node examples/plugin-excel-exporter.js",
|
|
80
|
+
"demo:express": "cd plugins/express-middleware && node example.js",
|
|
81
|
+
"size": "size-limit",
|
|
82
|
+
"size:why": "size-limit --why",
|
|
83
|
+
"benchmark": "npm run build && node dist/benchmark.js",
|
|
84
|
+
"benchmark:fastpath": "npm run build && node dist/benchmark.js --fastpath",
|
|
85
|
+
"profile:perf": "npm run build && node dist/scripts/profile-performance.js",
|
|
86
|
+
"example:plugins": "node examples/plugin-excel-exporter.js",
|
|
87
|
+
"example:express": "cd plugins/express-middleware && node example.js",
|
|
88
|
+
"plugins:build": "npm run build && cd plugins/express-middleware && npm run build && cd ../fastify-plugin && npm run build && cd ../nextjs-api && npm run build",
|
|
89
|
+
"docs": "typedoc",
|
|
90
|
+
"docs:watch": "typedoc --watch",
|
|
91
|
+
"docs:serve": "typedoc && npx serve docs/api",
|
|
92
|
+
"tsc": "tsc",
|
|
93
|
+
"tsc:dev": "tsc --project tsconfig.dev.json",
|
|
94
|
+
"tsc:build": "tsc --project tsconfig.build.json",
|
|
95
|
+
"tsc:watch": "tsc --project tsconfig.dev.json --watch",
|
|
96
|
+
"tsc:check": "tsc --noEmit --project tsconfig.build.json",
|
|
97
|
+
"tsc:check-strict": "tsc --noEmit --strict",
|
|
98
|
+
"tsc:types": "tsc --project tsconfig.types.json",
|
|
99
|
+
"test:ts": "jest --config jest.config.ts.js",
|
|
100
|
+
"test:ts:coverage": "jest --config jest.config.ts.js --coverage",
|
|
101
|
+
"test:ts:watch": "jest --config jest.config.ts.js --watch",
|
|
102
|
+
"test:types": "npm run tsc:build && node scripts/run-type-tests.js",
|
|
103
|
+
"build:ts": "npm run build",
|
|
104
|
+
"build:ts:watch": "npm run tsc:watch & npm run build:watch",
|
|
105
|
+
"lint:ts": "eslint --ext .ts,.tsx .",
|
|
106
|
+
"lint:ts:fix": "eslint --ext .ts,.tsx --fix ."
|
|
107
|
+
},
|
|
108
|
+
"keywords": [
|
|
109
|
+
"json",
|
|
110
|
+
"csv",
|
|
111
|
+
"converter",
|
|
112
|
+
"json-to-csv",
|
|
113
|
+
"csv-to-json",
|
|
114
|
+
"json2csv",
|
|
115
|
+
"csv2json",
|
|
116
|
+
"export",
|
|
117
|
+
"import",
|
|
118
|
+
"excel",
|
|
119
|
+
"data",
|
|
120
|
+
"transform",
|
|
121
|
+
"nodejs",
|
|
122
|
+
"browser",
|
|
123
|
+
"web-workers",
|
|
124
|
+
"streaming",
|
|
125
|
+
"security",
|
|
126
|
+
"csv-injection",
|
|
127
|
+
"javascript",
|
|
128
|
+
"typescript",
|
|
129
|
+
"simple",
|
|
130
|
+
"lightweight",
|
|
131
|
+
"zero-dependencies",
|
|
132
|
+
"utf8",
|
|
133
|
+
"cyrillic",
|
|
134
|
+
"bidirectional",
|
|
135
|
+
"cli",
|
|
136
|
+
"tui",
|
|
137
|
+
"terminal",
|
|
138
|
+
"interface",
|
|
139
|
+
"gui",
|
|
140
|
+
"tool",
|
|
141
|
+
"utility",
|
|
142
|
+
"plugin-system",
|
|
143
|
+
"ndjson",
|
|
144
|
+
"fast-path",
|
|
145
|
+
"optimization",
|
|
146
|
+
"performance",
|
|
147
|
+
"enterprise",
|
|
148
|
+
"express",
|
|
149
|
+
"fastify",
|
|
150
|
+
"nextjs",
|
|
151
|
+
"react",
|
|
152
|
+
"middleware",
|
|
153
|
+
"api",
|
|
154
|
+
"rest",
|
|
155
|
+
"http"
|
|
156
|
+
],
|
|
157
|
+
"author": "Ruslan Fomenko",
|
|
158
|
+
"license": "MIT",
|
|
159
|
+
"repository": {
|
|
160
|
+
"type": "git",
|
|
161
|
+
"url": "git+https://github.com/Linol-Hamelton/jtcsv.git"
|
|
162
|
+
},
|
|
163
|
+
"bugs": {
|
|
164
|
+
"url": "https://github.com/Linol-Hamelton/jtcsv/issues"
|
|
165
|
+
},
|
|
166
|
+
"homepage": "https://github.com/Linol-Hamelton/jtcsv#readme",
|
|
167
|
+
"engines": {
|
|
168
|
+
"node": ">=12.0.0"
|
|
169
|
+
},
|
|
170
|
+
"files": [
|
|
171
|
+
"index.d.ts",
|
|
172
|
+
"browser.d.ts",
|
|
173
|
+
"plugins.d.ts",
|
|
174
|
+
"schema.d.ts",
|
|
175
|
+
"bin/",
|
|
176
|
+
"dist/",
|
|
177
|
+
"src/",
|
|
178
|
+
"examples/"
|
|
179
|
+
],
|
|
180
|
+
"optionalDependencies": {
|
|
181
|
+
"glob": "^11.0.0"
|
|
182
|
+
},
|
|
183
|
+
"devDependencies": {
|
|
184
|
+
"@babel/core": "^7.26.0",
|
|
185
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
186
|
+
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
|
187
|
+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
188
|
+
"@babel/plugin-syntax-jsx": "7.28.6",
|
|
189
|
+
"@babel/preset-env": "^7.26.0",
|
|
190
|
+
"@babel/preset-react": "7.28.5",
|
|
191
|
+
"@eslint/js": "^9.18.0",
|
|
192
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
193
|
+
"@rollup/plugin-commonjs": "^28.0.0",
|
|
194
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
195
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
196
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
197
|
+
"@size-limit/preset-small-lib": "^11.1.0",
|
|
198
|
+
"@types/express": "5.0.6",
|
|
199
|
+
"@types/jest": "^29.5.14",
|
|
200
|
+
"@types/node": "^22.10.6",
|
|
201
|
+
"@typescript-eslint/eslint-plugin": "8.56.1",
|
|
202
|
+
"@typescript-eslint/parser": "8.56.1",
|
|
203
|
+
"blessed": "^0.1.81",
|
|
204
|
+
"blessed-contrib": "4.11.0",
|
|
205
|
+
"cross-env": "7.0.3",
|
|
206
|
+
"eslint": "^9.18.0",
|
|
207
|
+
"express": "5.2.1",
|
|
208
|
+
"globals": "^15.14.0",
|
|
209
|
+
"jest": "^29.7.0",
|
|
210
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
211
|
+
"rollup": "^4.30.0",
|
|
212
|
+
"size-limit": "^11.1.0",
|
|
213
|
+
"supertest": "7.2.2",
|
|
214
|
+
"ts-jest": "^29.2.5",
|
|
215
|
+
"ts-node": "^10.9.2",
|
|
216
|
+
"tsd": "0.33.0",
|
|
217
|
+
"tslib": "^2.8.1",
|
|
218
|
+
"typedoc": "^0.27.0",
|
|
219
|
+
"typescript": "^5.7.3",
|
|
220
|
+
"typescript-eslint": "8.56.1"
|
|
221
|
+
},
|
|
222
|
+
"type": "commonjs",
|
|
223
|
+
"sideEffects": false,
|
|
224
|
+
"size-limit": [
|
|
225
|
+
{
|
|
226
|
+
"path": "dist/jtcsv.umd.js",
|
|
227
|
+
"limit": "60 KB",
|
|
228
|
+
"ignore": [
|
|
229
|
+
"url"
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"path": "dist/jtcsv.esm.js",
|
|
234
|
+
"limit": "55 KB",
|
|
235
|
+
"ignore": [
|
|
236
|
+
"url"
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"browserslist": [
|
|
241
|
+
"defaults",
|
|
242
|
+
"not IE 11",
|
|
243
|
+
"maintained node versions"
|
|
244
|
+
]
|
|
245
|
+
}
|
package/plugins.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CsvToJsonOptions, JsonToCsvOptions, SaveAsCsvOptions } from './index';
|
|
2
|
+
|
|
3
|
+
export interface JtcsvWithPluginsOptions {
|
|
4
|
+
enableFastPath?: boolean;
|
|
5
|
+
enablePlugins?: boolean;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface PluginHookContext {
|
|
10
|
+
operation: string;
|
|
11
|
+
options?: any;
|
|
12
|
+
metadata?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class JtcsvWithPlugins {
|
|
16
|
+
constructor(options?: JtcsvWithPluginsOptions);
|
|
17
|
+
csvToJson(csv: string, options?: CsvToJsonOptions): Promise<any[]>;
|
|
18
|
+
csvToJsonIterator(csv: string, options?: CsvToJsonOptions): AsyncGenerator<any, void, unknown>;
|
|
19
|
+
jsonToCsv(json: any[], options?: JsonToCsvOptions): Promise<string>;
|
|
20
|
+
saveAsCsv(data: any[], filePath: string, options?: SaveAsCsvOptions): Promise<void>;
|
|
21
|
+
readCsvAsJson(filePath: string, options?: CsvToJsonOptions): Promise<any[]>;
|
|
22
|
+
parseNdjson(input: string | ReadableStream, options?: any): Promise<any[]>;
|
|
23
|
+
toNdjson(data: any[], options?: any): string;
|
|
24
|
+
fromNdjson(input: string, options?: any): any[];
|
|
25
|
+
use(name: string, plugin: any): void;
|
|
26
|
+
getStats(): any;
|
|
27
|
+
configure(newOptions: JtcsvWithPluginsOptions): this;
|
|
28
|
+
static create(options?: JtcsvWithPluginsOptions): JtcsvWithPlugins;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class PluginManager {}
|
|
32
|
+
export class FastPathEngine {}
|
|
33
|
+
export class NdjsonParser {}
|
|
34
|
+
|
|
35
|
+
export const create: typeof JtcsvWithPlugins.create;
|
|
36
|
+
|
|
37
|
+
export default JtcsvWithPlugins;
|