Hex Core JS
    Preparing search index...

    Function toCSV

    • Creates a CSV file using the given name and data. The columns argument is optional but recommended for better performance (avoids having to loop over the data to gather the column names) and control over the column order.

      Type Parameters

      • T extends Record<any, any>

      Parameters

      • name: string

        The name of the file. The file extension is optional and will be added automatically if not provided.

      • data: T[]

        The data to put in the file.

      • Optionalcolumns: (keyof T)[]

        An array of column names to include (in order) in the file.

      Returns { data: Blob; name: string }

      An object with a name key (file name) and data key (file blob).