# csv-loader

> A webpack module to intelligently load csv files.

Latest version **3.0.5** (published 2022-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install csv-loader
pnpm add csv-loader
yarn add csv-loader
bun add csv-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.5 |
| Published | 2022-07-21 |
| First published | 2016-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 44 |
| Author | scedast |
| Maintainers | scedast |
| Keywords | webpack, loader, csv, types, dynamicTyping, dynamic, conversion, automatic, parsing, Papa Parse, tsv, dsv |

## Links

- npm: https://www.npmjs.com/package/csv-loader
- Repository: https://github.com/theplatapi/csv-loader
- Issues: https://github.com/theplatapi/csv-loader/issues
- Funding: https://www.buymeacoffee.com/allenkoren
- npm.io page: https://npm.io/package/csv-loader

## Dependencies (2)

- [papaparse](https://npm.io/package/papaparse.md) ^5.2.0
- [loader-utils](https://npm.io/package/loader-utils.md) ^2.0.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 3.0.5 (latest) — 2022-07-21
- 3.0.3 — 2020-04-19
- 3.0.2 — 2018-07-06
- 3.0.1 — 2018-07-06
- 3.0.0 — 2018-07-06
- 2.1.1 — 2017-05-09
- 2.1.0 — 2017-04-22
- 2.0.4 — 2017-02-09
- 2.0.3 — 2017-02-09
- 2.0.2 — 2017-01-28
- 2.0.1 — 2016-08-12
- 2.0.0 — 2016-08-12
- 1.0.6 — 2016-08-12
- 1.0.5 — 2016-08-11
- 1.0.4 — 2016-08-11
- … 4 more at https://npm.io/package/csv-loader/versions

## README

# Webpack csv loader

[![NPM](https://img.shields.io/npm/v/csv-loader.svg)](https://npmjs.com/package/csv-loader)
[![NPM](https://img.shields.io/npm/dw/csv-loader.svg?maxAge=2592000)](https://npmjs.com/package/csv-loader)
[![Build Status](https://travis-ci.org/theplatapi/csv-loader.svg?branch=master)](https://travis-ci.org/theplatapi/csv-loader)


## 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:

``` javascript
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](http://papaparse.com/docs#config).



## 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

* Inspired by [dsv-loader](https://github.com/wbkd/dsv-loader)
* CSV parsing done with [Papa Parse](http://papaparse.com/)

---
_Source: https://npm.io/package/csv-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
