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

std/csv/mod.ts>ReadOptions

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

Properties

optional
separator: string = ","

Character which separates values.

optional
comment: string = "#"

Character to start a comment.

Lines beginning with the comment character without preceding whitespace are ignored. With leading whitespace the comment character becomes part of the field, even you provide trimLeadingSpace: true.

optional
trimLeadingSpace: boolean = false

Flag to trim the leading space of the value.

This is done even if the field delimiter, separator, is white space.

optional
lazyQuotes: boolean = false

Allow unquoted quote in a quoted field or non-double-quoted quotes in quoted field.

optional
fieldsPerRecord: number

Enabling checking number of expected fields for each row.

If positive, each record is required to have the given number of fields. If === 0, it will be set to the number of fields in the first row, so that future rows must have the same field count. If negative, no check is made and records may have a variable number of fields.

If the wrong number of fields is in a row, a ParseError is thrown.