# body-parser-csv

> CSV parser middleware for express.js

Latest version **1.2.1** (published 2026-02-12) · MIT license · 148 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install body-parser-csv
pnpm add body-parser-csv
yarn add body-parser-csv
bun add body-parser-csv
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2026-02-12 |
| First published | 2019-10-01 |
| Weekly downloads | 148 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Operátor ICT, a.s. |
| Maintainers | sinacek, benaktom, oict-robot |
| Keywords | body, parser, csv, bodyparsercsv, bodyparser, body-paser, body-parser-csv |

## Links

- npm: https://www.npmjs.com/package/body-parser-csv
- Repository: https://gitlab.com/operator-ict/golemio/code/body-parser-csv
- Homepage: https://gitlab.com/operator-ict/golemio/code/body-parser-csv#readme
- Issues: https://gitlab.com/operator-ict/golemio/code/body-parser-csv/issues
- npm.io page: https://npm.io/package/body-parser-csv

## Dependencies (6)

- [stream](https://npm.io/package/stream.md) ^0.0.2
- [express](https://npm.io/package/express.md) ^4.18.2
- [fast-csv](https://npm.io/package/fast-csv.md) ^4.3.6
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.19.2
- [ttypescript](https://npm.io/package/ttypescript.md) ^1.5.15

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2026-02-12
- 1.2.1-dev.2434001183 (dev) — 2026-04-07
- 1.2.1-rc.2321498463 (rc) — 2026-02-12
- 1.2.1-dev.2321499329 — 2026-02-12
- 1.2.1-rc.2321488888 — 2026-02-12
- 1.2.0-rc.2319459458 — 2026-02-11
- 1.2.0-dev.2307491576 — 2026-02-09
- 1.2.0-dev.943671291 — 2023-07-24
- 1.2.0-dev.877450837 — 2023-05-24
- 1.2.0 — 2023-05-24
- 1.1.0-dev.638998813 — 2022-09-13
- 1.1.0-dev.419960826 — 2021-12-01
- 1.1.0-dev.368640890 — 2021-09-10
- 1.1.0 — 2021-01-06
- 1.1.0-dev.238124158 — 2021-01-06
- … 8 more at https://npm.io/package/body-parser-csv/versions

## README

# body-parser-csv

This package is inspired by [body-parser-xml](https://www.npmjs.com/package/body-parser-xml) and is using [fast-csv](https://www.npmjs.com/package/fast-csv) for parsing.

Developed by http://operatorict.cz


## Prerequisites

- node.js (https://nodejs.org)
- npm (https://www.npmjs.com/)
- TypeScript (https://www.typescriptlang.org/)

## Installation

Install Node

Install all npm modules using command:
```
npm install
```

## Compilation of typescript code

To compile typescript code into js one-time

```
npm run build
```
or run this, to watch all changes
```
npm run build-watch
```
from the application's root directory.


## Usage

In your project's `package.json` set dependency to body-parser-csv
```
npm install body-parser-csv --save
```

Then import module, e.g.
```
const bodyParser = require("body-parser");
require("body-parser-csv")(bodyParser);
```


You can then use body-parser-csv the same way as you would use the body-parser-xml, with [csv parsing options](https://github.com/C2FO/fast-csv/blob/HEAD/docs/parsing.md) inside of the `csvParseOptions` parameter.

```
this.express.use(
    bodyParser.csv({
        csvParseOptions: {
            fastcsvParams: {
                headers: true,
                trim: true,
            },
            subscribe: ((json: any) => {
                // some line transformation
                return json;
            }),
        },
        limit: "15MB",
    })
);
```

## Documentation

For generating documentation run `npm run generate-docs`. TypeDoc source code documentation is located in `docs/typedoc`.

## Contribution guidelines

Please read `CONTRIBUTING.md`.

## Troubleshooting

Contact benak@operatorict.cz

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