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

std/encoding/csv.ts>ParseOptions

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
interface ParseOptions
implements ReadOptions
import { type ParseOptions } from "https://deno.land/std@0.78.0/encoding/csv.ts";

Properties

optional
skipFirstRow: boolean

If you provide skipFirstRow: true and columns, the first line will be skipped. If you provide skipFirstRow: true but not columns, the first line will be skipped and used as header definitions.

optional
columns: string[] | ColumnOptions[]

If you provide string[] or ColumnOptions[], those names will be used for header definition.

optional
parse: (input: unknown) => unknown

Parse function for rows. Example: const r = await parseFile('a,b,c\ne,f,g\n', { columns: ["this", "is", "sparta"], parse: (e: Record<string, unknown>) => { return { super: e.this, street: e.is, fighter: e.sparta }; } }); // output [ { super: "a", street: "b", fighter: "c" }, { super: "e", street: "f", fighter: "g" } ]