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.
Files changed (258) hide show
  1. package/README.md +205 -146
  2. package/bin/jtcsv.ts +280 -202
  3. package/browser.d.ts +142 -0
  4. package/dist/benchmark.js +446 -0
  5. package/dist/benchmark.js.map +1 -0
  6. package/dist/bin/jtcsv.js +1940 -0
  7. package/dist/bin/jtcsv.js.map +1 -0
  8. package/dist/csv-to-json.js +1261 -0
  9. package/dist/csv-to-json.js.map +1 -0
  10. package/dist/errors.js +291 -0
  11. package/dist/errors.js.map +1 -0
  12. package/dist/eslint.config.js +147 -0
  13. package/dist/eslint.config.js.map +1 -0
  14. package/dist/index-core.js +95 -0
  15. package/dist/index-core.js.map +1 -0
  16. package/dist/index.js +93 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/json-save.js +229 -0
  19. package/dist/json-save.js.map +1 -0
  20. package/dist/json-to-csv.js +576 -0
  21. package/dist/json-to-csv.js.map +1 -0
  22. package/dist/jtcsv-core.cjs.js +336 -7
  23. package/dist/jtcsv-core.cjs.js.map +1 -1
  24. package/dist/jtcsv-core.esm.js +336 -7
  25. package/dist/jtcsv-core.esm.js.map +1 -1
  26. package/dist/jtcsv-core.umd.js +336 -7
  27. package/dist/jtcsv-core.umd.js.map +1 -1
  28. package/dist/jtcsv-full.cjs.js +336 -7
  29. package/dist/jtcsv-full.cjs.js.map +1 -1
  30. package/dist/jtcsv-full.esm.js +336 -7
  31. package/dist/jtcsv-full.esm.js.map +1 -1
  32. package/dist/jtcsv-full.umd.js +336 -7
  33. package/dist/jtcsv-full.umd.js.map +1 -1
  34. package/dist/jtcsv-workers.esm.js +9 -0
  35. package/dist/jtcsv-workers.esm.js.map +1 -1
  36. package/dist/jtcsv-workers.umd.js +9 -0
  37. package/dist/jtcsv-workers.umd.js.map +1 -1
  38. package/dist/jtcsv.cjs.js +1998 -2092
  39. package/dist/jtcsv.cjs.js.map +1 -1
  40. package/dist/jtcsv.esm.js +1994 -2092
  41. package/dist/jtcsv.esm.js.map +1 -1
  42. package/dist/jtcsv.umd.js +2157 -2251
  43. package/dist/jtcsv.umd.js.map +1 -1
  44. package/dist/plugins/express-middleware/index.js +350 -0
  45. package/dist/plugins/express-middleware/index.js.map +1 -0
  46. package/dist/plugins/fastify-plugin/index.js +315 -0
  47. package/dist/plugins/fastify-plugin/index.js.map +1 -0
  48. package/dist/plugins/hono/index.js +111 -0
  49. package/dist/plugins/hono/index.js.map +1 -0
  50. package/dist/plugins/nestjs/index.js +192 -0
  51. package/dist/plugins/nestjs/index.js.map +1 -0
  52. package/dist/plugins/nuxt/index.js +53 -0
  53. package/dist/plugins/nuxt/index.js.map +1 -0
  54. package/dist/plugins/remix/index.js +133 -0
  55. package/dist/plugins/remix/index.js.map +1 -0
  56. package/dist/plugins/sveltekit/index.js +155 -0
  57. package/dist/plugins/sveltekit/index.js.map +1 -0
  58. package/dist/plugins/trpc/index.js +136 -0
  59. package/dist/plugins/trpc/index.js.map +1 -0
  60. package/dist/run-demo.js +49 -0
  61. package/dist/run-demo.js.map +1 -0
  62. package/dist/src/browser/browser-functions.js +193 -0
  63. package/dist/src/browser/browser-functions.js.map +1 -0
  64. package/dist/src/browser/core.js +123 -0
  65. package/dist/src/browser/core.js.map +1 -0
  66. package/dist/src/browser/csv-to-json-browser.js +353 -0
  67. package/dist/src/browser/csv-to-json-browser.js.map +1 -0
  68. package/dist/src/browser/errors-browser.js +219 -0
  69. package/dist/src/browser/errors-browser.js.map +1 -0
  70. package/dist/src/browser/extensions/plugins.js +106 -0
  71. package/dist/src/browser/extensions/plugins.js.map +1 -0
  72. package/dist/src/browser/extensions/workers.js +66 -0
  73. package/dist/src/browser/extensions/workers.js.map +1 -0
  74. package/dist/src/browser/index.js +140 -0
  75. package/dist/src/browser/index.js.map +1 -0
  76. package/dist/src/browser/json-to-csv-browser.js +225 -0
  77. package/dist/src/browser/json-to-csv-browser.js.map +1 -0
  78. package/dist/src/browser/streams.js +340 -0
  79. package/dist/src/browser/streams.js.map +1 -0
  80. package/dist/src/browser/workers/csv-parser.worker.js +264 -0
  81. package/dist/src/browser/workers/csv-parser.worker.js.map +1 -0
  82. package/dist/src/browser/workers/worker-pool.js +338 -0
  83. package/dist/src/browser/workers/worker-pool.js.map +1 -0
  84. package/dist/src/core/delimiter-cache.js +196 -0
  85. package/dist/src/core/delimiter-cache.js.map +1 -0
  86. package/dist/src/core/node-optimizations.js +279 -0
  87. package/dist/src/core/node-optimizations.js.map +1 -0
  88. package/dist/src/core/plugin-system.js +399 -0
  89. package/dist/src/core/plugin-system.js.map +1 -0
  90. package/dist/src/core/transform-hooks.js +348 -0
  91. package/dist/src/core/transform-hooks.js.map +1 -0
  92. package/dist/src/engines/fast-path-engine-new.js +262 -0
  93. package/dist/src/engines/fast-path-engine-new.js.map +1 -0
  94. package/dist/src/engines/fast-path-engine.js +671 -0
  95. package/dist/src/engines/fast-path-engine.js.map +1 -0
  96. package/dist/src/errors.js +18 -0
  97. package/dist/src/errors.js.map +1 -0
  98. package/dist/src/formats/ndjson-parser.js +332 -0
  99. package/dist/src/formats/ndjson-parser.js.map +1 -0
  100. package/dist/src/formats/tsv-parser.js +230 -0
  101. package/dist/src/formats/tsv-parser.js.map +1 -0
  102. package/dist/src/index-with-plugins.js +259 -0
  103. package/dist/src/index-with-plugins.js.map +1 -0
  104. package/dist/src/types/index.js +3 -0
  105. package/dist/src/types/index.js.map +1 -0
  106. package/dist/src/utils/bom-utils.js +267 -0
  107. package/dist/src/utils/bom-utils.js.map +1 -0
  108. package/dist/src/utils/encoding-support.js +77 -0
  109. package/dist/src/utils/encoding-support.js.map +1 -0
  110. package/dist/src/utils/schema-validator.js +609 -0
  111. package/dist/src/utils/schema-validator.js.map +1 -0
  112. package/dist/src/utils/transform-loader.js +281 -0
  113. package/dist/src/utils/transform-loader.js.map +1 -0
  114. package/dist/src/utils/validators.js +40 -0
  115. package/dist/src/utils/validators.js.map +1 -0
  116. package/dist/src/utils/zod-adapter.js +144 -0
  117. package/dist/src/utils/zod-adapter.js.map +1 -0
  118. package/{src → dist/src}/web-server/index.js +251 -286
  119. package/dist/src/web-server/index.js.map +1 -0
  120. package/dist/src/workers/csv-multithreaded.js +211 -0
  121. package/dist/src/workers/csv-multithreaded.js.map +1 -0
  122. package/dist/src/workers/csv-parser.worker.js +179 -0
  123. package/dist/src/workers/csv-parser.worker.js.map +1 -0
  124. package/dist/src/workers/worker-pool.js +228 -0
  125. package/dist/src/workers/worker-pool.js.map +1 -0
  126. package/dist/stream-csv-to-json.js +664 -0
  127. package/dist/stream-csv-to-json.js.map +1 -0
  128. package/dist/stream-json-to-csv.js +389 -0
  129. package/dist/stream-json-to-csv.js.map +1 -0
  130. package/examples/advanced/conditional-transformations.ts +2 -2
  131. package/examples/advanced/performance-optimization.ts +2 -2
  132. package/examples/cli-advanced-usage.md +2 -0
  133. package/examples/cli-tool.ts +1 -1
  134. package/examples/large-dataset-example.ts +2 -2
  135. package/examples/simple-usage.ts +2 -2
  136. package/examples/streaming-example.ts +1 -1
  137. package/index.d.ts +186 -15
  138. package/package.json +243 -305
  139. package/plugins.d.ts +37 -0
  140. package/schema.d.ts +103 -0
  141. package/src/browser/csv-to-json-browser.ts +233 -3
  142. package/src/browser/errors-browser.ts +45 -28
  143. package/src/browser/json-to-csv-browser.ts +81 -5
  144. package/src/browser/streams.ts +73 -6
  145. package/src/core/delimiter-cache.ts +21 -11
  146. package/src/core/plugin-system.ts +343 -155
  147. package/src/core/transform-hooks.ts +20 -12
  148. package/src/engines/fast-path-engine.ts +48 -32
  149. package/src/errors.ts +1 -72
  150. package/src/formats/ndjson-parser.ts +6 -0
  151. package/src/formats/tsv-parser.ts +6 -0
  152. package/src/types/index.ts +21 -1
  153. package/src/utils/validators.ts +35 -0
  154. package/src/web-server/index.ts +1 -1
  155. package/bin/jtcsv.js +0 -2532
  156. package/csv-to-json.js +0 -711
  157. package/errors.js +0 -394
  158. package/examples/advanced/conditional-transformations.js +0 -446
  159. package/examples/advanced/csv-parser.worker.js +0 -89
  160. package/examples/advanced/nested-objects-example.js +0 -306
  161. package/examples/advanced/performance-optimization.js +0 -504
  162. package/examples/advanced/run-demo-server.js +0 -116
  163. package/examples/cli-batch-processing.js +0 -38
  164. package/examples/cli-tool.js +0 -183
  165. package/examples/error-handling.js +0 -338
  166. package/examples/express-api.js +0 -164
  167. package/examples/large-dataset-example.js +0 -182
  168. package/examples/ndjson-processing.js +0 -434
  169. package/examples/plugin-excel-exporter.js +0 -406
  170. package/examples/schema-validation.js +0 -640
  171. package/examples/simple-usage.js +0 -282
  172. package/examples/streaming-example.js +0 -418
  173. package/examples/web-workers-advanced.js +0 -28
  174. package/index.js +0 -82
  175. package/json-save.js +0 -255
  176. package/json-to-csv.js +0 -668
  177. package/plugins/README.md +0 -91
  178. package/plugins/express-middleware/README.md +0 -83
  179. package/plugins/express-middleware/example.js +0 -135
  180. package/plugins/express-middleware/example.ts +0 -135
  181. package/plugins/express-middleware/index.d.ts +0 -114
  182. package/plugins/express-middleware/index.js +0 -512
  183. package/plugins/express-middleware/index.ts +0 -557
  184. package/plugins/express-middleware/package.json +0 -52
  185. package/plugins/fastify-plugin/index.js +0 -404
  186. package/plugins/fastify-plugin/index.ts +0 -443
  187. package/plugins/fastify-plugin/package.json +0 -55
  188. package/plugins/hono/README.md +0 -28
  189. package/plugins/hono/index.d.ts +0 -12
  190. package/plugins/hono/index.js +0 -36
  191. package/plugins/hono/index.ts +0 -226
  192. package/plugins/hono/package.json +0 -35
  193. package/plugins/nestjs/README.md +0 -35
  194. package/plugins/nestjs/index.d.ts +0 -25
  195. package/plugins/nestjs/index.js +0 -77
  196. package/plugins/nestjs/index.ts +0 -201
  197. package/plugins/nestjs/package.json +0 -37
  198. package/plugins/nextjs-api/README.md +0 -57
  199. package/plugins/nextjs-api/examples/ConverterComponent.jsx +0 -386
  200. package/plugins/nextjs-api/examples/ConverterComponent.tsx +0 -386
  201. package/plugins/nextjs-api/examples/api-convert.js +0 -67
  202. package/plugins/nextjs-api/examples/api-convert.ts +0 -67
  203. package/plugins/nextjs-api/index.js +0 -387
  204. package/plugins/nextjs-api/index.tsx +0 -339
  205. package/plugins/nextjs-api/package.json +0 -63
  206. package/plugins/nextjs-api/route.js +0 -370
  207. package/plugins/nextjs-api/route.ts +0 -370
  208. package/plugins/nuxt/README.md +0 -24
  209. package/plugins/nuxt/index.js +0 -21
  210. package/plugins/nuxt/index.ts +0 -94
  211. package/plugins/nuxt/package.json +0 -35
  212. package/plugins/nuxt/runtime/composables/useJtcsv.js +0 -6
  213. package/plugins/nuxt/runtime/composables/useJtcsv.ts +0 -100
  214. package/plugins/nuxt/runtime/plugin.js +0 -6
  215. package/plugins/nuxt/runtime/plugin.ts +0 -71
  216. package/plugins/remix/README.md +0 -26
  217. package/plugins/remix/index.d.ts +0 -16
  218. package/plugins/remix/index.js +0 -62
  219. package/plugins/remix/index.ts +0 -260
  220. package/plugins/remix/package.json +0 -35
  221. package/plugins/sveltekit/README.md +0 -28
  222. package/plugins/sveltekit/index.d.ts +0 -17
  223. package/plugins/sveltekit/index.js +0 -54
  224. package/plugins/sveltekit/index.ts +0 -301
  225. package/plugins/sveltekit/package.json +0 -33
  226. package/plugins/trpc/README.md +0 -25
  227. package/plugins/trpc/index.d.ts +0 -7
  228. package/plugins/trpc/index.js +0 -32
  229. package/plugins/trpc/index.ts +0 -267
  230. package/plugins/trpc/package.json +0 -34
  231. package/src/browser/browser-functions.js +0 -219
  232. package/src/browser/core.js +0 -92
  233. package/src/browser/csv-to-json-browser.js +0 -722
  234. package/src/browser/errors-browser.js +0 -212
  235. package/src/browser/extensions/plugins.js +0 -92
  236. package/src/browser/extensions/workers.js +0 -39
  237. package/src/browser/index.js +0 -113
  238. package/src/browser/json-to-csv-browser.js +0 -319
  239. package/src/browser/streams.js +0 -403
  240. package/src/browser/workers/csv-parser.worker.js +0 -377
  241. package/src/browser/workers/worker-pool.js +0 -527
  242. package/src/core/delimiter-cache.js +0 -200
  243. package/src/core/node-optimizations.js +0 -408
  244. package/src/core/plugin-system.js +0 -494
  245. package/src/core/transform-hooks.js +0 -350
  246. package/src/engines/fast-path-engine-new.js +0 -338
  247. package/src/engines/fast-path-engine.js +0 -844
  248. package/src/errors.js +0 -26
  249. package/src/formats/ndjson-parser.js +0 -467
  250. package/src/formats/tsv-parser.js +0 -339
  251. package/src/index-with-plugins.js +0 -378
  252. package/src/utils/bom-utils.js +0 -259
  253. package/src/utils/encoding-support.js +0 -124
  254. package/src/utils/schema-validator.js +0 -594
  255. package/src/utils/transform-loader.js +0 -205
  256. package/src/utils/zod-adapter.js +0 -170
  257. package/stream-csv-to-json.js +0 -560
  258. package/stream-json-to-csv.js +0 -465
package/package.json CHANGED
@@ -1,307 +1,245 @@
1
- {
2
- "name": "jtcsv",
3
- "version": "3.0.0",
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
- "require": "./dist/jtcsv.cjs.js",
21
- "import": "./dist/jtcsv.esm.js",
22
- "browser": "./dist/jtcsv.umd.js",
23
- "default": "./dist/jtcsv.esm.js"
24
- },
25
- "./plugins": {
26
- "require": "./src/index-with-plugins.js",
27
- "import": "./src/index-with-plugins.js",
28
- "default": "./src/index-with-plugins.js"
29
- },
30
- "./express": {
31
- "require": "./plugins/express-middleware/index.js",
32
- "import": "./plugins/express-middleware/index.js",
33
- "default": "./plugins/express-middleware/index.js"
34
- },
35
- "./fastify": {
36
- "require": "./plugins/fastify-plugin/index.js",
37
- "import": "./plugins/fastify-plugin/index.js",
38
- "default": "./plugins/fastify-plugin/index.js"
39
- },
40
- "./nextjs": {
41
- "require": "./plugins/nextjs-api/index.js",
42
- "import": "./plugins/nextjs-api/index.js",
43
- "default": "./plugins/nextjs-api/index.js"
44
- },
45
- "./nextjs/route": {
46
- "require": "./plugins/nextjs-api/route.js",
47
- "import": "./plugins/nextjs-api/route.js",
48
- "default": "./plugins/nextjs-api/route.js"
49
- },
50
- "./nestjs": {
51
- "require": "./plugins/nestjs/index.js",
52
- "import": "./plugins/nestjs/index.js",
53
- "default": "./plugins/nestjs/index.js"
54
- },
55
- "./remix": {
56
- "require": "./plugins/remix/index.js",
57
- "import": "./plugins/remix/index.js",
58
- "default": "./plugins/remix/index.js"
59
- },
60
- "./nuxt": {
61
- "require": "./plugins/nuxt/index.js",
62
- "import": "./plugins/nuxt/index.js",
63
- "default": "./plugins/nuxt/index.js"
64
- },
65
- "./sveltekit": {
66
- "require": "./plugins/sveltekit/index.js",
67
- "import": "./plugins/sveltekit/index.js",
68
- "default": "./plugins/sveltekit/index.js"
69
- },
70
- "./hono": {
71
- "require": "./plugins/hono/index.js",
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 tsc:build && npm run build",
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.js",
233
- "json-to-csv.js",
234
- "csv-to-json.js",
235
- "errors.js",
236
- "stream-json-to-csv.js",
237
- "stream-csv-to-json.js",
238
- "json-save.js",
239
- "index.d.ts",
240
- "bin/",
241
- "dist/",
242
- "src/",
243
- "examples/",
244
- "plugins/"
245
- ],
246
- "optionalDependencies": {
247
- "glob": "^11.0.0"
248
- },
249
- "devDependencies": {
250
- "@babel/core": "^7.26.0",
251
- "@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
252
- "@babel/plugin-proposal-optional-chaining": "7.21.0",
253
- "@babel/plugin-syntax-dynamic-import": "7.8.3",
254
- "@babel/plugin-syntax-jsx": "7.28.6",
255
- "@babel/preset-env": "^7.26.0",
256
- "@babel/preset-react": "7.28.5",
257
- "@eslint/js": "^9.18.0",
258
- "@rollup/plugin-babel": "^6.0.4",
259
- "@rollup/plugin-commonjs": "^28.0.0",
260
- "@rollup/plugin-node-resolve": "^16.0.0",
261
- "@rollup/plugin-terser": "^0.4.4",
262
- "@rollup/plugin-typescript": "^12.1.2",
263
- "@size-limit/preset-small-lib": "^11.1.0",
264
- "@types/express": "5.0.6",
265
- "@types/jest": "^29.5.14",
266
- "@types/node": "^22.10.6",
267
- "blessed": "^0.1.81",
268
- "blessed-contrib": "4.11.0",
269
- "eslint": "^9.18.0",
270
- "express": "5.2.1",
271
- "globals": "^15.14.0",
272
- "jest": "^29.7.0",
273
- "jest-environment-jsdom": "^29.7.0",
274
- "rollup": "^4.30.0",
275
- "size-limit": "^11.1.0",
276
- "supertest": "7.2.2",
277
- "ts-jest": "^29.2.5",
278
- "ts-node": "^10.9.2",
279
- "tsd": "0.33.0",
280
- "tslib": "^2.8.1",
281
- "typedoc": "^0.27.0",
282
- "typescript": "^5.7.3"
283
- },
284
- "type": "commonjs",
285
- "sideEffects": false,
286
- "size-limit": [
287
- {
288
- "path": "dist/jtcsv.umd.js",
289
- "limit": "60 KB",
290
- "ignore": [
291
- "url"
292
- ]
293
- },
294
- {
295
- "path": "dist/jtcsv.esm.js",
296
- "limit": "55 KB",
297
- "ignore": [
298
- "url"
299
- ]
300
- }
301
- ],
302
- "browserslist": [
303
- "defaults",
304
- "not IE 11",
305
- "maintained node versions"
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;