@wholebuzz/fs / Exports / csv
▸ parseCSV(stream: ReadableStreamTree, options?: CSVParseOptions): Promise<unknown[]>
Parses CSV from [[stream]]. Used to implement readCSV.
| 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(stream: WritableStreamTree, options?: CSVFormatOptions): WritableStreamTree
Create CSV formatter stream.
| Name | Type |
|---|---|
stream |
WritableStreamTree |
options? |
CSVFormatOptions |
Returns: WritableStreamTree
Defined in: src/csv.ts:22
▸ pipeCSVParser(stream: ReadableStreamTree, options?: CSVParseOptions): ReadableStreamTree
Create CSV parser stream.
| Name | Type |
|---|---|
stream |
ReadableStreamTree |
options? |
CSVParseOptions |
Returns: ReadableStreamTree
Defined in: src/csv.ts:12
▸ readCSV(fileSystem: FileSystem, url: string, options?: CSVParseOptions): Promise<unknown[]>
Reads a serialized JSON object or array from a file.
| 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(stream: WritableStreamTree, obj: any[], options?: CSVFormatOptions): Promise<boolean>
Serializes CSV object to [[stream]]. Used to implement writeCSV.
| 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(fileSystem: FileSystem, url: string, value: any[], options?: CSVFormatOptions): Promise<boolean>
Serializes object or array to a CSV file.
| 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