Socket
Socket
Sign inDemoInstall

parse-formdata

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-formdata

Parse formdata in Node


Version published
Weekly downloads
153
increased by44.34%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 28 Jun 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc