
CSV
Parsing CSV in the Browser With Papa Parse Without Blocking
Parse an uploaded CSV in the browser with Papa Parse: typing traps, error objects, encodings, and chunks and workers measured on 500,000 rows.
11 min read
Tag
17 posts

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

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.

Read a large CSV in Node with fs.createReadStream and csv-parse, filter with pipeline, stop early, and handle errors, BOMs and Windows-1252 files.

A tested guide to CSV in JavaScript: csv-parse, Papa Parse and a hand-written parser timed on 2,000,000 rows, plus streams, types, uploads and downloads.

Text copied from console.log, DevTools or a config file is often a JavaScript object, not JSON. What differs, what is lost, and how to convert it safely.