CSVUtils
This CSVUtils class use csv-parser for csv parsing and transform csv data from fetch. @todo: verify on web environment
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Public Members | ||
| public get |
CoreCSV: * return csv parser instance |
|
| public |
csv: * |
|
| public |
fetch: * |
|
| public |
fs: * |
|
Method Summary
| Public Methods | ||
| public |
async chunkCSV(filePath: *, recordPerChunk: *, destFilePattern: *): * |
|
| public |
async fetchCSV(url: URL ): Promise fetch csv content from given url |
|
| public |
async readCSV(filePath: *): * |
|
| public |
async writeCSV(header: *, data: *, filePath: *): * |
|
Public Constructors
public constructor() source
Public Methods
public async chunkCSV(filePath: *, recordPerChunk: *, destFilePattern: *): * source
Params:
| Name | Type | Attribute | Description |
| filePath | * | ||
| recordPerChunk | * | ||
| destFilePattern | * |
Return:
| * |
public async fetchCSV(url: URL ): Promise source
fetch csv content from given url
Params:
| Name | Type | Attribute | Description |
| url | URL | url for csv content |
Return:
| Promise | data promise with data if success |
TODO:
- enhance reject case
public async readCSV(filePath: *): * source
Params:
| Name | Type | Attribute | Description |
| filePath | * |
Return:
| * |
public async writeCSV(header: *, data: *, filePath: *): * source
Params:
| Name | Type | Attribute | Description |
| header | * | ||
| data | * | ||
| filePath | * |
Return:
| * |