Skip to content

ParseBinaryOptions

github-actions[bot] edited this page Dec 25, 2023 · 1 revision

web-csv-toolbox / Exports / ParseBinaryOptions

Interface: ParseBinaryOptions<Header>

Parse options for CSV binary.

Type parameters

Name Type
Header extends ReadonlyArray<string>

Hierarchy

Table of contents

Properties

Properties

charset

• Optional charset: string

You can specify the character encoding of the binary.

Remarks

TextDecoderStream is used internally. See Encoding API Compatibility for the encoding formats that can be specified.

Default

'utf-8'

Inherited from

BinaryOptions.charset

Defined in

src/common/types.ts:75


decomposition

• Optional decomposition: CompressionFormat

If the binary is compressed by a compression algorithm, the decompressed CSV can be parsed by specifying the algorithm.

Remarks

Make sure the runtime you are running supports stream decompression. See DecompressionStream Compatibility.

Inherited from

BinaryOptions.decomposition

Defined in

src/common/types.ts:64


demiliter

• Optional demiliter: string

CSV field delimiter.

Remarks

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

This library supports multi-character delimiters.

Default

','

Inherited from

ParseOptions.demiliter

Defined in

src/common/types.ts:40


fatal

• Optional fatal: boolean

If the binary has a invalid character, you can specify whether to throw an error.

Remarks

If you specify true, an error will be thrown. If you specify false or not specify it, the invalid character will be replaced with U+FFFD. See TextDecoderOptions.fatal for more information about the invalid character.

Inherited from

BinaryOptions.fatal

Defined in

src/common/types.ts:94


header

• Optional 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

Inherited from

ParseOptions.header

Defined in

src/common/types.ts:120


ignoreBOM

• Optional ignoreBOM: boolean

If the binary has a BOM, you can specify whether to ignore it.

Remarks

If you specify true, the BOM will be ignored. If you specify false or not specify it, the BOM will be treated as a normal character. See TextDecoderOptions.ignoreBOM for more information about the BOM.

Default

false

Inherited from

BinaryOptions.ignoreBOM

Defined in

src/common/types.ts:85


quotation

• Optional quotation: string

CSV field quotation.

Remarks

This library supports multi-character quotations.

Default

'"'

Inherited from

ParseOptions.quotation

Defined in

src/common/types.ts:49

Clone this wiki locally