Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/csv/parse.ts>parse

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function parse
import { parse } from "https://deno.land/std@0.209.0/csv/parse.ts";

Csv parse helper to manipulate data. Provides an auto/custom mapper for columns.

Examples

Example 1

import { parse } from "https://deno.land/std@0.209.0/csv/parse.ts";
const string = "a,b,c\nd,e,f";

console.log(
  await parse(string, {
    skipFirstRow: false,
  }),
);
// output:
// [["a", "b", "c"], ["d", "e", "f"]]

Parameters

input: string

Input to parse.

optional
opt: undefined

options of the parser.

Returns

string[][]

If you don't provide opt.skipFirstRow and opt.columns, it returns string[][]. If you provide opt.skipFirstRow or opt.columns, it returns Record<string, unknown>[].