import { type ParseOptions } from "https://deno.land/std@0.72.0/encoding/csv.ts";
Properties
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.
If you provide string[]
or ColumnOptions[]
, those names will be used for header definition.
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" } ]