Socket
Socket
Sign inDemoInstall

@middy/http-json-body-parser

Package Overview
Dependencies
1
Maintainers
3
Versions
214
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/http-json-body-parser


Version published
Maintainers
3
Install size
33.0 kB
Created

Package description

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

Readme

Source

Middy http-json-body-parser middleware

Middy logo

HTTP json body parser middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda

npm version npm install size GitHub Actions CI status badge
Standard Code Style Known Vulnerabilities Language grade: JavaScript Core Infrastructure Initiative (CII) Best Practices
Chat on Gitter Ask questions on StackOverflow

You can read the documentation at: https://middy.js.org/docs/middlewares/http-json-body-parser

License

Licensed under MIT License. Copyright (c) 2017-2023 Luciano Mammino, will Farrell, and the Middy team.

FOSSA Status

Keywords

FAQs

Last updated on 21 May 2023

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc