Fast in-browser CSV parser for JavaScript that streams large files and handles malformed input, with no dependencies
open sourceMITfree
Papa Parse is a CSV (and other delimited text) parser for JavaScript that runs in the browser and is correct according to RFC 4180, by Matt Holt. It parses local files or files over the network, streams large files (even over HTTP), auto-detects the delimiter, handles header rows, converts numbers and booleans to their types, and correctly handles line breaks and quotes inside fields. It can run in worker threads to keep a page responsive, pause, resume and abort parsing, and convert JSON back to CSV. It has no dependencies, installs with npm install papaparse, and is MIT licensed.
Problems it solves
- I need to parse a user's uploaded CSV file in the browser
- I want to stream a huge CSV file without freezing the page
- I need to turn JSON data into a downloadable CSV in JavaScript
Features
- RFC 4180 CSV parsing in the browser
- Streams large files, including over HTTP
- Auto-detects delimiters; header rows
- Worker threads for responsive pages
- Pause, resume and abort
- Type conversion of numbers and booleans
- JSON to CSV
- No dependencies
