web-csv-toolbox - v0.15.0
    Preparing search index...

    Function toArray

    • Parse CSV from a File to array of records.

      Type Parameters

      • Header extends readonly string[]

      Parameters

      Returns Promise<Record<Header[number], string>[]>

      Array of records

      import { parseFile } from 'web-csv-toolbox';

      const input = document.querySelector('input[type="file"]');
      input.addEventListener('change', async (event) => {
      const file = event.target.files[0];
      const records = await parseFile.toArray(file);
      console.log(records);
      });