
Converting CSV to JSON in Node With a Few Lines of Code
Convert a CSV to JSON or NDJSON in Node with csv-parse, keep ZIP codes as text, and stream 2,000,000 rows at 120 MB instead of 1.6 GB.
Tag
590 posts

Convert a CSV to JSON or NDJSON in Node with csv-parse, keep ZIP codes as text, and stream 2,000,000 rows at 120 MB instead of 1.6 GB.

Turn orders with repeating items into a workbook a spreadsheet user can filter: one sheet per level linked by order id, or one wide sheet, plus the checks.

Turn a nested YAML document into path, type and value rows with a short recursive generator, then load the rows into SQL to search and compare configs.

Use SQL on an Excel sheet to find repeated keys, missing numbers in a sequence and missing dates with GROUP BY, window functions and gaps and islands.

What happens when you open an XML file in Excel, the choices it offers, why leading zeros and long numbers change, and a safer route that keeps text as text.

Build a CSV string, wrap it in a Blob and trigger a download with an object URL. Covers escaping, the Excel BOM, formula guards and how 1,000,000 rows behave.

Parse an uploaded CSV in the browser with Papa Parse: typing traps, error objects, encodings, and chunks and workers measured on 500,000 rows.

Load a YAML list into an in-memory SQLite table as JSON text and query it with json_extract and json_each, with a json_valid check that rejects bad rows.

What json_valid accepts in SQLite with each flag, why a CHECK can pass a NULL, how to find bad rows, add a check to an existing table and check JSONB blobs.

Summarize a sales workbook with GROUP BY: totals by region and month, averages, rollups and ranking, with checks that make the numbers trustworthy.

Excel exports XML only through an XML map built from a schema. The 65,536 row cap, the constructs that block export, and a script that does the same job.

The csv-parse options that matter on big files in Node: columns, cast, on_record, relax_quotes and max_record_size, timed on 2,000,000 rows.