Repository navigation
Breaking Changes
- Empty-record skipping is enabled by default in the parser, file validation and CLI. It now includes delimiter-only and quoted-empty records; quoted whitespace remains data. Set
skipEmptyLines: falseor usecsv-parser input.csv --no-skip-empty-linesto preserve empty records. Strict physical widths still apply, except for skipped unquoted blank/whitespace-only lines. Nonboolean empty-skipping options are rejected.
Features
- Opt-in
sanitizeRightPaddingremoves only a contiguous suffix of exactly empty source header names. Interior unnamed columns, named columns and deliberately named mapped headers remain. Any nonempty discarded cell, including whitespace, fails before value mapping; strict widths use the original physical schema. validateFilesandreplayFilessupport ordered multipart preflight/replay with frozen schema, retained-boundary and cleanup metadata. Optional file-onlysanitizeBottomremoves the final empty-record suffix across the logical set. Parts are parsed independently, without buffering the empty suffix or modifying sources.
Ordinary streams do not trim bottom records and may emit earlier rows before a later padding error. Complete preflight before destructive work; keep source bytes and deterministic mappings unchanged between validation and replay. Strict delimiter/quoted-empty width errors and enabled strict quote errors remain fatal at EOF. Native ESM and Node.js ^22.22.2 || >=24.15.0 support are unchanged.
Full Changelog: v4.3.0...v5.0.0