New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

form-data-parser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-data-parser

Middleware that parses FormData requests and places them on req.body

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

form-data-parser

Middleware for connect or express that parses FormData in a sane way, no streams necessary.

Note: Originally made to work with the ember-cli-form-data addon.

Build Status Coverage Status
NPM

Usage

npm install form-data-parser --save
var express = require('express');
var formDataParser = require('form-data-parser');

var app = express();
var fdp = formDataParser({
  attrs: {
    comments: 'array',
    coverPhoto: 'dataUri'
  }
});

/**
 * Sent
 * {
 *   blogPost: {
 *     comments: [1, 2],
 *     coverPhoto: formDataFile
 *   }
 * }
*/
app.post('/api/blog-post', fdp, function (req, res) {
  // req.body => { blogPost: comments: [1, 2], coverPhoto: 'data: image/png; base64, dasfe254....' }
});

Keywords

middleware

FAQs

Package last updated on 20 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts