Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

parse-formdata

1.0.2 • Public • Published

parse-formdata

npm version build status downloads js-standard-style

Parse formdata in Node.

Usage

var parseFormdata = require('parse-formdata')
var http = require('http')
 
http.createServer(function (req, res) {
  parseFormdata(req, function (err, data) {
    if (err) throw err
    console.log('fields:', data.fields)
    data.parts.forEach(function (part) {
      console.log('part:', part.fieldname)
    })
    res.end('Be kind to each other')
  })
}).listen(8080)

API

parseFormdata(req, cb(err, data))

Parse formdata from an HTTP request. data has the following fields:

  • fields: key-value data from fields
  • parts: an array of streams for the multipart file uploads
  • preamble: an array of data from the preamble event
  • epilogue: an array of data from the epilogue event

See Also

License

MIT

install

npm i parse-formdata

Downloadsweekly downloads

176

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability