parsed-body

Get the parsed body of a request

Usage no npm install needed!

<script type="module">
  import parsedBody from 'https://cdn.skypack.dev/parsed-body';
</script>

README

parsed-body

Install

npm install --save parsed-body

Usage

import parsedBody from 'parsed-body/json';

async req => {
  const body = await parsedBody(req);
  console.log('body:', body);
}

Important: This consumes the body, so it isn't always safe to call it multiple times. If you use the same version of parsed-body, it will work though.