How to use the papaparse/papaparse.js.parse function in papaparse

To help you get started, we’ve selected a few papaparse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rexrainbow / phaser3-rex-notes / examples / papaparser / parse-csv.js View on Github external
create() {
        var csvString = `,2,3
4,5,6
7,8,9`;
        var data = Papa.parse(csvString, {
            dynamicTyping: true
        });
        console.log(data);  // a 3x3 array

        csvString = `name,hp,mp
4,5,6
7,8,9`;
        data = Papa.parse(csvString, {
            dynamicTyping: true,
            header: true
        });
        console.log(data);  // an object array with 2 rows
    }
github rexrainbow / phaser3-rex-notes / examples / papaparser / parse-csv.js View on Github external
create() {
        var csvString = `,2,3
4,5,6
7,8,9`;
        var data = Papa.parse(csvString, {
            dynamicTyping: true
        });
        console.log(data);  // a 3x3 array

        csvString = `name,hp,mp
4,5,6
7,8,9`;
        data = Papa.parse(csvString, {
            dynamicTyping: true,
            header: true
        });
        console.log(data);  // an object array with 2 rows
    }
github rexrainbow / phaser3-rex-notes / examples / lokijs / load-csv-table.js View on Github external
create() {
        var csvString = `name,hp,mp
Rex,100,20
Alice,300,40`;

        var csvTable = Papa.parse(csvString, {
            dynamicTyping: true,
            header: true
        }).data;

        // Create the database
        var db = new loki();

        // Create a collection
        var children = db.addCollection('children');

        // insert csv-table
        children.insert(csvTable);

        var result = children.chain().data();
        console.log(result);
    }
github turnerniles / react-virtualized-pivot / src / app.jsx View on Github external
handleFileSelect(evt) {
    const file = evt.target.files[0];

    Papa.parse(file, {
      complete: (results) => {
        this.setState({data: results.data, headerRow: results.data[0]});
      },
    });
  }
github turnerniles / react-virtualized-pivot / src / app.jsx View on Github external
}
    if (dataSize.value === 'medium') {
      this.setState({
        dataSize: dataSize.value,
        data: data.mediumData,
        headerRow: data.mediumData[0],
        isLoaded: true,
        selectedAggregationDimension: 'Quantity',
      });
    }
    if (dataSize.value === 'large') {
      this.setState({
        dataSize: dataSize.value,
        isLoaded: false,
      });
      Papa.parse('https://raw.githubusercontent.com/turnerniles/' +
        'react-virtualized-pivot/master/src/sampledata/RejectStatsA.csv', {
        download: true,
        complete: (results) => {
          this.setState({
            data: results.data,
            headerRow: results.data[0],
            selectedAggregationDimension: 'Amount Requested',
            isLoaded: true,
          });
        },
      });
    }
  }

papaparse

Fast and powerful CSV parser for the browser that supports web workers and streaming large files. Converts CSV to JSON and JSON to CSV.

MIT
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis