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)
npm install jtcsv


Fast JSON <-> CSV conversion with streaming helpers, NDJSON/TSV support, and optional integrations.
bash
npm install jtcsv
`$3
`bash
npm install @jtcsv/tui
npm install @jtcsv/excel exceljs
npm install @jtcsv/validator
`Quick start (Node.js)
`javascript
const { jsonToCsv, csvToJson } = require('jtcsv');const data = [
{ id: 1, name: 'John', email: 'john@example.com' },
{ id: 2, name: 'Jane', email: 'jane@example.com' }
];
const csv = jsonToCsv(data, { delimiter: ',', includeHeaders: true });
const json = csvToJson(csv, { delimiter: ',', parseNumbers: true });
console.log(csv);
console.log(json);
`$3
`javascript
const { csvToJsonIterator } = require('jtcsv');const csv = 'id,name\n1,Jane\n2,John';
$3
JTCSV includes a powerful CLI for batch conversion, file processing, and data transformation.
`bash
Convert CSV file to JSON
npx jtcsv csv-to-json data.csv --output data.jsonConvert JSON to CSV with custom delimiter
npx jtcsv json-to-csv data.json --delimiter ";" --output out.csvStream processing with NDJSON
npx jtcsv csv-to-ndjson large.csv --stream > output.ndjsonSee all options
npx jtcsv --help
`Full documentation: CLI.md
for await (const row of csvToJsonIterator(csv, { fastPathMode: 'compact' })) {
console.log(row);
}
`Browser usage
- Bundler: import { csvToJson, jsonToCsv } from 'jtcsv/browser';
- CDN UMD: https://cdn.jsdelivr.net/npm/jtcsv/dist/jtcsv.umd.js
- CDN ESM: https://cdn.jsdelivr.net/npm/jtcsv/dist/jtcsv.esm.jsSee
README-browser.md for full browser API and worker helpers.CLI
`bash
npx jtcsv csv-to-json input.csv output.json
npx jtcsv json-to-csv input.json output.csv
npx jtcsv stream csv-to-json big.csv output.json
npx jtcsv batch json-to-csv "data/*.json" output/optional TUI
npx jtcsv tui
`See
CLI.md for full command list and options.Demos
Run these from the repo root:
`bash
Express API demo
npm run demoWeb demo (Vite dev server on http://localhost:3000)
npm run demo:webPreview built demo
npm run demo:serve
`From inside
demo/ use:
`bash
npm run dev
npm run preview
npm run serve
`Plugin system
The plugin-enabled API is exported from jtcsv/plugins.`javascript
const { create } = require('jtcsv/plugins');const jtcsv = create();
jtcsv.use('my-plugin', { name: 'My Plugin', version: '1.0.0' });
`See
README-PLUGINS.md and plugins/README.md for integrations.Development
Run from the repo root:
`bash
npm test
npm run test:coverage
npm run test:coverage:entry
npm run test:coverage:ts
npm run test:types
npm run tsc:types
npm run build
`Linux validation (Docker):
`bash
docker run --rm -v /path/to/jtcsv:/work -w /work node:20 bash -lc "npm ci && npm test"
`License
MIT. See LICENSE`.