csv-parse

A flexible, dependency-free CSV parser for Node.js and the browser with stream, callback, and sync APIs.

Library
npm
v7.0.3
4,287 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
78 /100 Good
Development Activity 96
Maintenance 52
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 90
Code Quality 88
Innovation 87
Learning Curve 85

csv-parse is a mature CSV parser that converts CSV text into arrays or objects. It implements the Node.js stream.Transform API while also offering simpler callback and synchronous interfaces, so you can pick the flavor that fits your workload. First released in 2010 and part of the broader CSV project by Adaltas, it is battle-tested against large datasets by a wide community.

The parser handles the full range of real-world CSV quirks: custom delimiters, quotes, escape characters, comments, BOM handling, and automatic line-break discovery. It ships with zero external dependencies and multiple distributions covering Node.js, the web, ECMAScript modules, and CommonJS.

What You Get

  • A streaming parser implementing the Node.js stream.Transform API for backpressure-aware pipelines
  • Callback and synchronous APIs for convenient one-shot parsing without wiring up streams
  • A rich option set covering delimiters, quotes, escapes, comments, columns, casting, and BOM handling
  • Multiple distributions: Node.js, browser, ESM, and CommonJS with bundled TypeScript type definitions
  • Zero runtime dependencies and support across Node.js 8 through the latest release

Common Use Cases

  • Ingesting large CSV exports into a Node.js data pipeline via streams
  • Parsing user-uploaded CSV files into typed objects in a web application
  • Quickly converting a CSV string to an array of records synchronously in a script or test
  • Reading delimited data (TSV, colon-separated, custom delimiters) from external systems

Under The Hood

Architecture

csv-parse is structured around a framework-agnostic parsing core in lib/api/index.js (the transform function) that maintains an incremental byte-level state machine, tracking quoting, escapes, record delimiters, comments, and column mapping across buffer chunks via init_state.js and normalize_options.js. Three thin adapters wrap this core: lib/index.js exposes a Parser class extending Node’s stream.Transform plus a flexible parse() function that detects string/options/callback arguments; lib/sync.js drives the same core in a single blocking pass; and lib/stream.js provides a web-stream binding. Records flow out through a push callback, keeping the engine decoupled from the delivery mechanism.

Tech Stack

Written in modern JavaScript (ESM source) with hand-authored TypeScript declarations (lib/index.d.ts). The package is dependency-free at runtime and built with Rollup, producing CJS and ESM/browser distributions under dist/. Dev tooling includes Mocha with tsx for tests, Prettier, ESLint, and TypeScript for type-checking. It is part of a Lerna-managed monorepo alongside csv-generate, csv-stringify, and stream-transform.

Code Quality

Code quality is high. The repository holds roughly 90 test files plus 72 sample inputs, giving the parser broad coverage across options and edge cases; tests run under Mocha against both JS and TS. Errors are surfaced through a dedicated CsvError class carrying stable error codes (e.g. CSV_INVALID_ARGUMENT), and option normalization is centralized and heavily validated. Naming is descriptive and the core is clearly separated from its stream/sync/web adapters.

API Design

The public API is deliberately ergonomic: a single parse entry point accepts data, options, and callback in flexible order, while csv-parse/sync and csv-parse/stream subpath exports keep each usage style explicit. Options are richly documented on csv.js.org with numerous examples, and TypeScript types are bundled. Getting started requires almost no boilerplate for the sync and callback paths, while the stream API follows familiar Node.js conventions.

Used by 36 apps in this directory

JavaScript
64%
AGPL 3.0

overleaf

Collaboration · Productivity

18,266

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
84
Repo Health
80
Technical
59
Dependency
Built with
JavaScript 64%
TypeScript 30%
Updated 1 months ago
TypeScript
96%
MIT

Payload CMS

Blogging · CMS · Developer Tools

45,458

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
92
Repo Health
88
Technical
65
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
96%
MIT

Payload CMS

Blogging · CMS · Developer Tools

45,458

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
92
Repo Health
88
Technical
65
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
98%
MIT

Promptfoo

AI Development

26,358

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
67
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
98%
MIT

Promptfoo

AI Development

26,358

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
67
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
97%
Other

Rocket.Chat

Team Chat

46,304

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
63
Dependency
Built with
TypeScript 97%
Updated 5 days ago
TypeScript
99%
Other

Rowy

Databases · Low Code Platforms

6,842

Manage Firestore data in an Airtable-like spreadsheet UI and build Cloud Functions workflows directly in your browser—on your own GCP project.

View details
45
Repo Health
71
Technical
65
Dependency
Built with
TypeScript 99%
Updated 1 years ago
TypeScript
97%
AGPL 3.0

Swetrix

Analytics

1,213

Privacy-first, cookieless web analytics with error tracking, session replays, and performance monitoring — self-host or use Cloud.

View details
87
Repo Health
71
Technical
66
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,920

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
78
Repo Health
76
Technical
62
Dependency
Built with
TypeScript 99%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers