# express-multipart-file-parser

> [![npm version](https://badge.fury.io/js/express-multipart-file-parser.svg)](https://badge.fury.io/js/express-multipart-file-parser) [![Code style: airbnb](https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square)](https://github.com/ai

Latest version **0.1.2** (published 2018-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-multipart-file-parser
pnpm add express-multipart-file-parser
yarn add express-multipart-file-parser
bun add express-multipart-file-parser
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-06-23 |
| First published | 2018-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/express-multipart-file-parser) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Cristóvão Trevisan |
| Maintainers | cristovao-trevisan |

## Links

- npm: https://www.npmjs.com/package/express-multipart-file-parser
- Repository: https://github.com/cristovao-trevisan/express-multipart-file-parser
- Homepage: https://github.com/cristovao-trevisan/express-multipart-file-parser#readme
- Issues: https://github.com/cristovao-trevisan/express-multipart-file-parser/issues
- npm.io page: https://npm.io/package/express-multipart-file-parser

## Dependencies (3)

- [busboy](https://npm.io/package/busboy.md) ^0.2.14
- [raw-body](https://npm.io/package/raw-body.md) ^2.3.2
- [content-type](https://npm.io/package/content-type.md) ^1.0.4

## Recent versions

- 0.1.2 (latest) — 2018-06-23
- 0.1.1 — 2018-03-09
- 0.1.0 — 2018-02-23
- 0.0.3 — 2018-02-15
- 0.0.2 — 2018-02-08
- 0.0.1 — 2018-02-06

## README

[![npm version](https://badge.fury.io/js/express-multipart-file-parser.svg)](https://badge.fury.io/js/express-multipart-file-parser)
[![Code style: airbnb](https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square)](https://github.com/airbnb/javascript)

# Express Multipart File Parser

Parser for express that allows file upload with *multipart/form-data*

**Works with Google Cloud Functions**

## Usage

```js
// default parser without destructuring
const fileParser = require('express-multipart-file-parser')

...
app.use(fileParser)
...

app.post('/file', (req, res) => {
  const {
    fieldname,
    originalname,
    encoding,
    mimetype,
    buffer,
  } = req.files[0]
  ...
})
```

### Usage with Options


```js
// must use destructuring for options
const { fileParser } = require('express-multipart-file-parser')

...
app.use(fileParser({
  rawBodyOptions: {
    limit: '15mb',
  },
  busboyOptions: {
    limits: {
      fields: 2
    }
  },
}))
```

## Options

- rawBodyOptions: see [raw-body](https://github.com/stream-utils/raw-body#api)
- busboyOptions: see [busboy](https://github.com/mscdex/busboy#busboy-methods)

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