JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20205
  • Score
    100M100P100Q130678F
  • License MIT

Module to parse multiform data

Package Exports

  • express-form-data

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-form-data) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

express-form-data

Module to parse multiform data. Based on connect-multiparty

Install

npm install express-form-data

Example

const formData = require("express-form-data");
const express = require("express");
const app = express();

const multipartyOptions = {
  autoFiles: true;
};

// parse a data with connect-multiparty. 
app.use(formData.parse(multipartyOptions));
// clear all empty files (size == 0)
app.use(formData.format());
// change file objects to node stream.Readable 
app.use(formData.stream());
// union body and files
app.use(formData.union());

After this functions we can see in req:

  • req.files = {...} all files
  • req.body = {...} all data including files(or streams if you use .stream())