# express-form-data

> Module to parse multipart/form data

Latest version **3.0.1** (published 2025-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-form-data
pnpm add express-form-data
yarn add express-form-data
bun add express-form-data
```

## Health

**Score 33/100 (F)** — status: maintenance-mode.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2025-06-18 |
| First published | 2015-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/express-form-data) |
| Module format | CommonJS |
| Node | >=10.7.0 |
| Dependencies | 6 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexander Balasyan |
| Maintainers | ortex |
| Keywords | express, form, data, multipart, multipart/form, json |

## Links

- npm: https://www.npmjs.com/package/express-form-data
- Repository: https://github.com/ortexx/express-form-data
- Homepage: https://github.com/ortexx/express-form-data#readme
- Issues: https://github.com/ortexx/express-form-data/issues
- npm.io page: https://npm.io/package/express-form-data

## Dependencies (6)

- [type-is](https://npm.io/package/type-is.md) ^2.0.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.1.0
- [multiparty](https://npm.io/package/multiparty.md) ^4.2.3
- [http-errors](https://npm.io/package/http-errors.md) ^2.0.0
- [on-finished](https://npm.io/package/on-finished.md) ^2.4.1
- [signal-exit](https://npm.io/package/signal-exit.md) ^3.0.7

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.0.1 (latest) — 2025-06-18
- 3.0.0 — 2025-06-11
- 2.0.23 — 2023-12-29
- 2.0.22 — 2023-02-22
- 2.0.21 — 2023-02-22
- 2.0.20 — 2023-02-22
- 2.0.19 — 2022-10-07
- 2.0.18 — 2022-04-18
- 2.0.17 — 2021-06-05
- 2.0.16 — 2021-04-03
- 2.0.14 — 2020-07-21
- 2.0.13 — 2020-05-08
- 2.0.12 — 2020-03-22
- 2.0.11 — 2020-01-20
- 2.0.10 — 2019-07-13
- … 13 more at https://npm.io/package/express-form-data/versions

## README

# express-form-data
Module to parse multipart/form data.

# Install 
`npm install express-form-data`

# Example
```js
const formData = require("express-form-data");
const express = require("express");
const os = require("os");
const app = express();

/**
 * Options are the same as multiparty takes.
 * But there is a new option "autoClean" to clean all files in "uploadDir" folder after the response.
 * By default, it is "false".
 */
const options = {
  uploadDir: os.tmpdir(),
  autoClean: true
};

// parse data with connect-multiparty. 
app.use(formData.parse(options));
// delete from the request all empty files (size == 0)
app.use(formData.format());
// change the file objects to fs.ReadStream 
app.use(formData.stream());
// union the body and the files
app.use(formData.union());
```

After this we can see in req:  
* req.files = {...} all files  
* req.body = {...} all data including files (or streams if you use .stream())

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