Interface ParseOptions<Header>

Parse options for CSV string.

interface ParseOptions<Header> {
    delimiter?: string;
    header?: Header;
    quotation?: string;
}

Type Parameters

  • Header extends ReadonlyArray<string>

Hierarchy (view full)

Properties

delimiter?: string

CSV field delimiter. If you want to parse TSV, specify '\t'.

Remarks

Detail restrictions are as follows:

  • Must not be empty
  • Must be a single character
    • Multi-byte characters are not supported
  • Must not include CR or LF
  • Must not be the same as the quotation

Default

','
header?: Header

CSV header.

Remarks

If you specify this option, the first record will be treated as a normal record.

If you don't specify this option, the first record will be treated as a header.

Default

undefined
quotation?: string

CSV field quotation.

Default

'"'