csv-loader

3.0.5 • Public • Published

Webpack csv loader

NPM NPM Build Status

Purpose

This CSV loader automatically converts data types, making it easy to import and start using data.

Installation

Install with npm:

npm install --save-dev csv-loader

Usage

Add the csv-loader to your webpack configuration:

const config = {
  module: {
    rules: [
      {
        test: /\.csv$/,
        loader: 'csv-loader',
        options: {
          dynamicTyping: true,
          header: true,
          skipEmptyLines: true
        }
      }
    ]
  }
};

The loader will translate csv files into JSON, with the following settings:

  • automatically convert columns to the proper data type,
  • parse the CSV header
  • skip any blank lines in the file

Configuration

Any options supported by Papa Parse can be passed to this loader with the options object. The current Papa Parse API is available here.

Not just a CSV loader

This module works with any column based file separated by deliminators. Simply set which extension to parse and the loader will automatically figure out which deliminator to use by default. The deliminator can also be manually set.

Credits

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.5
    19,792
    • latest

Version History

Package Sidebar

Install

npm i csv-loader

Weekly Downloads

27,709

Version

3.0.5

License

MIT

Unpacked Size

4.15 kB

Total Files

5

Last publish

Collaborators

  • scedast