express-formparse7

2.1.3 • Public • Published

express-formparse7

An Express middleware that uses Formidable to parse incoming multi-part forms.

What are Express, Formidable, and this?

Express is a fast, unopinionated, minimalist web framework for Node.js.

Formidable is a Node.js module for parsing form data, especially file uploads.

So, express-formparse is something like a bridge between them, specifically an Express middleware implementation of Formidable.

Install

npm i -S express-formparse7

How

const express = require('express');
const formparse = require('express-formparse');
 
const app = express();
 
app.use(formparse.parse({
    encoding: 'utf8',
    uploadDir: 'tmp_upload',
    keepExtensions: true,
    hash: 'md5',
    multiples: true,
}));
 
app.post('/upload', (req, res) => {
  // req.body will contain the parsed form
  // req.files will contain file metadata
});
formparse.parse([options])

The keys and values in options will be directly passed to the formidable IncomingForm. (See node-formidable API for reference).

Only requests having a multipart/form-data content-type will be parsed.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.3
    0
  • 2.1.2
    0
  • 2.1.1
    0
  • 2.1.0
    0

Package Sidebar

Install

npm i express-formparse7

Weekly Downloads

0

Version

2.1.3

License

MIT

Unpacked Size

5.34 kB

Total Files

4

Last publish

Collaborators

  • kornel