Skip to content

Latest commit

 

History

History
132 lines (80 loc) · 3.42 KB

File metadata and controls

132 lines (80 loc) · 3.42 KB

@wholebuzz/fs / Exports / csv

Module: csv

Table of contents

Functions

Functions

parseCSV

parseCSV(stream: ReadableStreamTree, options?: CSVParseOptions): Promise<unknown[]>

Parses CSV from [[stream]]. Used to implement readCSV.

Parameters

Name Type Description
stream ReadableStreamTree The stream to read a CSV object from.
options? CSVParseOptions -

Returns: Promise<unknown[]>

Defined in: src/csv.ts:33


pipeCSVFormatter

pipeCSVFormatter(stream: WritableStreamTree, options?: CSVFormatOptions): WritableStreamTree

Create CSV formatter stream.

Parameters

Name Type
stream WritableStreamTree
options? CSVFormatOptions

Returns: WritableStreamTree

Defined in: src/csv.ts:22


pipeCSVParser

pipeCSVParser(stream: ReadableStreamTree, options?: CSVParseOptions): ReadableStreamTree

Create CSV parser stream.

Parameters

Name Type
stream ReadableStreamTree
options? CSVParseOptions

Returns: ReadableStreamTree

Defined in: src/csv.ts:12


readCSV

readCSV(fileSystem: FileSystem, url: string, options?: CSVParseOptions): Promise<unknown[]>

Reads a serialized JSON object or array from a file.

Parameters

Name Type Description
fileSystem FileSystem -
url string The URL of the file to parse a JSON object or array from.
options? CSVParseOptions -

Returns: Promise<unknown[]>

Defined in: src/csv.ts:41


serializeCSV

serializeCSV(stream: WritableStreamTree, obj: any[], options?: CSVFormatOptions): Promise<boolean>

Serializes CSV object to [[stream]]. Used to implement writeCSV.

Parameters

Name Type Description
stream WritableStreamTree The stream to write a CSV object to.
obj any[] -
options? CSVFormatOptions -

Returns: Promise<boolean>

Defined in: src/csv.ts:49


writeCSV

writeCSV(fileSystem: FileSystem, url: string, value: any[], options?: CSVFormatOptions): Promise<boolean>

Serializes object or array to a CSV file.

Parameters

Name Type Description
fileSystem FileSystem -
url string The URL of the file to serialize a CSV object or array to.
value any[] The object or array to serialize.
options? CSVFormatOptions -

Returns: Promise<boolean>

Defined in: src/csv.ts:66