Skip to content

v2.0.0

Latest

Choose a tag to compare

@donatj donatj released this 10 Sep 17:31
· 10 commits to master since this release
a59f2ec

What's Changed

This is a major release. Existing calls to csvToMarkdown() should continue to work, but parsing now uses a fully featured CSV parser and output may differ slightly.

If you depend on the current parsing behaviour you should continue to use 1.x - it will continue to be maintained for securty and compatibility for the forseeable future but will not see new development.

Breaking changes

  • Node.js 20 or newer is now required.
  • CSV parsing now uses a full CSV parser. Output may change, especially for quoted fields, escaped characters, embedded newlines, and malformed CSV.
    • Quotes from quoted cells are no longer included in the output. Fixes #118.
  • CSV delimiters must be one character.
  • The browser package field was removed; use the package exports or the UMD build directly.

Upgrading

  • Upgrade Node to 20+.
  • Verify output for CSV containing quotes, escapes, or multiline fields.
  • Pass a single-character delimiter.
  • Browser build setups that read browser directly should use lib/CsvToMarkdown.js.

Changes

  • Added an optional fourth options argument to csvToMarkdown().
  • Added enclosure and escape options for CSV parsing.
  • Added newlineReplacement to control newlines within cells.
  • Added cellFilter to transform cell values; it receives zero-based row and column indexes.
  • Added prettyPrint: false for compact Markdown output.
  • Improved CommonJS and TypeScript support, CLI UTF-8 handling, and CLI validation.

Pull Requests

  • Enhance dependabot config for TypeScript ESLint by @donatj in #159
  • Modernize npm dev toolchain by @donatj with @Copilot in #164
  • Small handful of lessons learned from upgrading a different node project. by @donatj in #178
  • Upgrade to TypeScript 6 by @donatj in #202
  • Use Oxlint and Oxfmt by @donatj in #199
  • Use Oxlint and Oxfmt by @donatj in #209
  • Test CLI input safely by @donatj in #210
  • v2 - Modernization & Rework by @donatj in #198
  • Add conversion options for cell filtering and table formatting by @donatj in #212
  • Add optional enclosure and escape settings by @donatj in #214
  • Add pretty print checkbox to browser example by @donatj in #213
  • Preserve UTF-8 characters across CLI input chunks by @donatj in #215
  • Match CommonJS declarations to the callable export by @donatj in #217
  • Preserve boundary whitespace in CLI and browser input by @donatj in #216
  • Pass row and column indexes to cellFilter by @donatj in #219

Dependabot Updates

Full Changelog: v1.6.3...v2.0.0