Constructor
new CSVDoc(filePath, separatoropt)
- Description:
Setup the CSVDoc instance with the file path. methods to access its data. It reads the file, processes the CSV content, and provides methods to get the file path, file content, column names, and perform aggregations on specific columns.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
filePath |
string | The absolute path to the csv file |
||
separator |
string |
<optional> |
,
|
The separator of the CSV |
Classes
Methods
aggregateColumn(name) → {Aggregation}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the column |
Returns:
Returns the aggregation class for the column
- Type
- Aggregation
getColumns() → {Array}
Returns:
An array of column names
- Type
- Array
getFile() → {object}
Returns:
The fs.readFileSync() object of the file
- Type
- object
getFilePath() → {string}
Returns:
The string of the absolute file path
- Type
- string