/csv-parse

Dead simple to use CSV parser

Primary LanguageTypeScript

@jlarky/csv-parse JSR

Installation

bunx jsr add @jlarky/csv-parse
# or
npx jsr add @jlarky/csv-parse

Example

import { parse } from "@jlarky/csv-parse";

const input = "a,b,c\n1,2,3\n4,5,6";
const options = { columns: true };

const result = await parse(input, options);

if (result.success) {
  console.log(result.records);
} else {
  console.error(result.err);
}

Browser

const { parse } = await import("https://esm.sh/jsr/@jlarky/csv-parse@latest");
await parse("123,456")

Development

To install dependencies:

bun install

To test:

bun test

To publish:

bun run publish