Incremental CSV Parser is a fast, lightweight, and dependency-free library for parsing Comma Separated Values (CSV) data in both browser and Node.js environments. It currently stands at stable version 1.1.1, with recent updates (like v1.1.0 adding `.headers()`) indicating active maintenance, though a strict release cadence is not specified. Key differentiators include its incremental parsing API, full compliance with RFC4180, and minimal footprint due to zero external dependencies. A crucial aspect of its design is that all parsed column values are returned as strings, meaning it does not automatically parse numbers, dates, or other data types, requiring explicit conversion by the consumer. It provides both ESM and CJS builds and ships with TypeScript type definitions for enhanced developer experience.
npm install incremental-csv-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the `CSVParser` class for incremental processing of CSV data chunks, collecting parsed rows, and accessing headers.
Implement explicit type conversion logic for specific columns after receiving the parsed row objects (e.g., `parseInt(row.id, 10)`, `new Date(row.timestamp)`).
Prefer `import` statements (e.g., `import { parse } from 'incremental-csv-parser';`) in ESM projects. If strictly using CommonJS, ensure your environment correctly handles the CJS build.Ensure your project uses `import { CSVParser } from 'incremental-csv-parser';` when operating in an ESM environment. If using CommonJS, verify correct `const { CSVParser } = require('incremental-csv-parser');` usage and project setup.Define a union type for your column names (e.g., `type MyColumns = 'id' | 'name';`) and pass it as a generic to the parser: `new CSVParser<MyColumns>(...)` or `parse<MyColumns>(...)`.
After parsing, explicitly convert the string values to the desired data type using standard JavaScript functions like `Number()`, `parseInt()`, `parseFloat()`, or `new Date()`.
No dependency data recorded yet.