Socket
Book a DemoInstallSign in
Socket

micro-body

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-body

micro body parser

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

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 { }.

Keywords

micro

FAQs

Package last updated on 29 Jan 2018

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