micro-body

0.1.2 • Public • Published

micro-body

Simple body parser for micro

Use it as expected in your micro module:

const microBody = require('micro-body')

module.exports.POST = async (req, res) => {
  let body = await microBody(req)
  return body
}

micro-body can parse urlencoded and json body types, but throws an error if content-type header has another type.

If request hasn't got body or no content-type header is present micro-body returns an empty object { }.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    6,308
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    6,308
  • 0.1.1
    0
  • 0.1.0
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i micro-body

Weekly Downloads

6,308

Version

0.1.2

License

MIT

Last publish

Collaborators

  • devgar