Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@middy/http-json-body-parser

Package Overview
Dependencies
Maintainers
10
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/http-json-body-parser

Http JSON body parser middleware for the middy framework

  • 1.0.0-alpha.34
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
decreased by-79.39%
Maintainers
10
Weekly downloads
 
Created

What is @middy/http-json-body-parser?

@middy/http-json-body-parser is a middleware for AWS Lambda functions that automatically parses JSON-encoded request bodies. It simplifies the process of handling JSON input in serverless applications by converting the body of incoming HTTP requests into a JavaScript object.

What are @middy/http-json-body-parser's main functionalities?

Automatic JSON Parsing

This feature automatically parses the JSON body of incoming HTTP requests and makes it available as a JavaScript object in `event.body`. This eliminates the need to manually parse the JSON string in each handler.

const middy = require('@middy/core');
const jsonBodyParser = require('@middy/http-json-body-parser');

const handler = middy((event, context) => {
  // event.body is now a parsed JSON object
  return {
    statusCode: 200,
    body: JSON.stringify({ message: 'Parsed body', data: event.body })
  };
});

handler.use(jsonBodyParser());

module.exports = { handler };

Other packages similar to @middy/http-json-body-parser

Keywords

FAQs

Package last updated on 23 Jun 2019

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