std/encoding/csv.ts

Deno standard library
Go to Latest
function parse
import { parse } from "https://deno.land/std@0.145.0/encoding/csv.ts?s=parse";

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

Parameters

input: string | BufReader[src]

Input to parse. Can be a string or BufReader.

Returns

Promise<string[][]>[src]

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, unkown>[].

Parameters

input: string | BufReader[src]
opt: Omit<ParseOptions, "columns" | "skipFirstRow">[src]

Returns

Promise<string[][]>[src]

Parameters

input: string | BufReader[src]
opt: Omit<ParseOptions, "columns"> & { columns: string[] | ColumnOptions[]; }[src]

Returns

Promise<Record<string, unknown>[]>[src]

Parameters

input: string | BufReader[src]
opt: Omit<ParseOptions, "skipFirstRow"> & { skipFirstRow: true; }[src]

Returns

Promise<Record<string, unknown>[]>[src]

Parameters

input: string | BufReader[src]
opt: ParseOptions[src]

Returns

Promise<string[][] | Record<string, unknown>[]>[src]

Parameters

input: string | BufReader[src]
optional
opt: ParseOptions
[src]

Returns

Promise<string[][] | Record<string, unknown>[]>[src]