Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "node_modules/@modelx/data/src/csv"

Index

Type aliases

CSVJSON

CSVJSON: CSVJSONRow[]

CSVJSONRow

CSVJSONRow: {}

Type declaration

  • [index: string]: string

CSVOptions

CSVOptions: {}

Type declaration

  • [index: string]: string | boolean

FilePath

FilePath: String

Functions

loadCSV

  • Asynchronously loads a CSV from either a filepath or remote URL and returns an array of objects

    example

    // returns [{header:value,header2:value2}] loadCSV('../mock/invalid-file.csv').then(csvData).catch(console.error)

    Parameters

    • filepath: string

      URL to CSV path

    • Optional options: CSVOptions

    Returns Promise<CSVJSON>

    returns an array of objects from a csv where each column header is the property name

loadCSVURI

loadTSV

  • loadTSV(filepath: string, options?: CSVOptions): Promise<{}[]>
  • Asynchronously loads a TSV from either a filepath or remote URL and returns an array of objects

    example

    // returns [{header:value,header2:value2}] loadCSV('../mock/invalid-file.tsv').then(csvData).catch(console.error)

    Parameters

    • filepath: string

      URL to CSV path

    • Optional options: CSVOptions

    Returns Promise<{}[]>

    returns an array of objects from a csv where each column header is the property name