{"id":13456327,"url":"https://github.com/middyjs/middy","last_synced_at":"2026-10-18T20:20:58.158Z","repository":{"id":37484119,"uuid":"99244740","full_name":"middyjs/middy","owner":"middyjs","description":"🛵 The stylish Node.js middleware engine for AWS Lambda 🛵","archived":false,"fork":false,"pushed_at":"2026-10-10T22:27:02.000Z","size":69664,"stargazers_count":3904,"open_issues_count":9,"forks_count":398,"subscribers_count":34,"default_branch":"main","last_synced_at":"2026-10-12T11:28:01.230Z","etag":null,"topics":["aws","aws-lambda","aws-powertools","aws-serverless","framework","javascript","lambda","lambda-handler","middleware","middy","node","nodejs","powertools","serverless","serverless-applications","serverless-express","serverless-framework","typescript"],"latest_commit_sha":null,"homepage":"https://middy.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/middyjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":"docs/GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"github":["willfarrell","lmammino"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-08-03T14:59:07.000Z","updated_at":"2026-10-09T03:16:40.000Z","dependencies_parsed_at":"2026-10-04T00:07:53.731Z","dependency_job_id":null,"html_url":"https://github.com/middyjs/middy","commit_stats":{"total_commits":1897,"total_committers":199,"mean_commits":9.532663316582914,"dds":0.3500263574064312,"last_synced_commit":"9126e6ff2d75eaac9338bfe652f7f8904f4356d0"},"previous_names":["plnt9/middy"],"tags_count":436,"template":false,"template_full_name":null,"purl":"pkg:github/middyjs/middy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middyjs%2Fmiddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middyjs%2Fmiddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middyjs%2Fmiddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middyjs%2Fmiddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/middyjs","download_url":"https://codeload.github.com/middyjs/middy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middyjs%2Fmiddy/sbom","scorecard":{"id":112145,"data":{"date":"2025-08-14T19:01:17Z","repo":{"name":"github.com/middyjs/middy","commit":"9bdaef316bc54afcaae8524525ec2a8715bc70f9"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":9.7,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:80","Info: jobLevel 'contents' permission set to 'read': .github/workflows/release.yml:112","Info: jobLevel 'contents' permission set to 'read': .github/workflows/release.yml:21","Info: jobLevel 'contents' permission set to 'read': .github/workflows/test-sast.yml:47","Info: jobLevel 'actions' permission set to 'read': .github/workflows/test-sast.yml:46","Info: topLevel permissions set to 'read-all': .github/workflows/ossf-scorecard.yml:19","Info: topLevel 'contents' permission set to 'read': .github/workflows/release.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-dast.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-dco.yml:7","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-lint.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-pref.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-sast.yml:13","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-types.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/test-unit.yml:7","Info: topLevel 'contents' permission set to 'read': .github/workflows/website-publish.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/website-test.yml:12"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":9,"reason":"dependency not pinned by hash detected -- score normalized to 9","details":["Warn: npmCommand not pinned by hash: .github/workflows/test-sast.yml:38","Info:  39 out of  39 GitHub-owned GitHubAction dependencies pinned","Info:   4 out of   4 third-party GitHubAction dependencies pinned","Info:   8 out of   9 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"CII-Best-Practices","score":7,"reason":"badge detected: Silver","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:106"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"name":"Branch-Protection","score":10,"reason":"branch protection is fully enabled on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'main'","Info: 'stale review dismissal' is required to merge on branch 'main'","Info: required approving review count is 2 on branch 'main'","Info: codeowner review is required on branch 'main'","Info: 'last push approval' is required to merge on branch 'main'","Info: 'up-to-date branches' is required to merge on branch 'main'","Info: status check found to merge onto on branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: JavaScriptPropertyBasedTesting integration found: packages/appconfig/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/cloudformation-response/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/cloudformation-router/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/cloudwatch-metrics/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/core/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/do-not-wait-for-empty-event-loop/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/dynamodb/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/error-logger/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/event-normalizer/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-content-encoding/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-content-negotiation/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-cors/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-error-handler/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-event-normalizer/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-header-normalizer/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-json-body-parser/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-multipart-body-parser/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-partial-response/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-response-serializer/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-router/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-security-headers/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-urlencode-body-parser/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/http-urlencode-path-parser/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/input-output-logger/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/rds-signer/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/s3-object-response/index.fuzz.js:4","Info: JavaScriptPropertyBasedTesting integration found: packages/s3/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/secrets-manager/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/service-discovery/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/sqs-partial-batch-failure/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/ssm/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/sts/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/validator/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/warmup/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/ws-json-body-parser/index.fuzz.js:2","Info: JavaScriptPropertyBasedTesting integration found: packages/ws-response/index.fuzz.js:7","Info: JavaScriptPropertyBasedTesting integration found: packages/ws-router/index.fuzz.js:2"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"CI-Tests","score":10,"reason":"8 out of 8 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"Contributors","score":10,"reason":"project has 28 contributing companies or organizations","details":["Info: found contributions from: FullStackBulletin, GlobantUy, Oryzone, PartidoDigital, QwikDev, augustsn, aws, aws-samples, awsbites, empathycom, fastify, fourtheorem, global cyber alliance, gqty-dev, js-uy, kushki, lint-staged, lucpod, middyjs, nodejs-design-patterns-book, qwikifiers, rust-italia, s-group-dev, serverless-heaven, serverlessdays-dublin, standards, typeorm, ucudal"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}}]},"last_synced_at":"2025-08-15T12:32:27.213Z","repository_id":37484119,"created_at":"2025-08-15T12:32:27.213Z","updated_at":"2025-08-15T12:32:27.213Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":343843146,"owners_count":38276430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-13T02:00:04.984Z","response_time":52,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-powertools","aws-serverless","framework","javascript","lambda","lambda-handler","middleware","middy","node","nodejs","powertools","serverless","serverless-applications","serverless-express","serverless-framework","typescript"],"created_at":"2024-07-31T08:01:19.940Z","updated_at":"2026-10-18T20:20:58.154Z","avatar_url":"https://github.com/middyjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/willfarrell","https://github.com/sponsors/lmammino"],"categories":["JavaScript","Official","Open Source Repos","Networking and Distributed","Template features"],"sub_categories":["Lambda","Cloud and Infrastructure","3rd party libraries"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"Middy logo\" src=\"https://raw.githubusercontent.com/middyjs/middy/main/docs/img/middy-logo.svg\"/\u003e\n  \u003cp\u003e\u003cstrong\u003eThe stylish Node.js middleware engine for AWS Lambda\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/actions/workflows/test-unit.yml\"\u003e\u003cimg src=\"https://github.com/middyjs/middy/actions/workflows/test-unit.yml/badge.svg\" alt=\"GitHub Actions unit test status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/actions/workflows/test-dast.yml\"\u003e\u003cimg src=\"https://github.com/middyjs/middy/actions/workflows/test-dast.yml/badge.svg\" alt=\"GitHub Actions dast test status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/actions/workflows/test-perf.yml\"\u003e\u003cimg src=\"https://github.com/middyjs/middy/actions/workflows/test-perf.yml/badge.svg\" alt=\"GitHub Actions perf test status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/actions/workflows/test-sast.yml\"\u003e\u003cimg src=\"https://github.com/middyjs/middy/actions/workflows/test-sast.yml/badge.svg\" alt=\"GitHub Actions SAST test status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/actions/workflows/test-lint.yml\"\u003e\u003cimg src=\"https://github.com/middyjs/middy/actions/workflows/test-lint.yml/badge.svg\" alt=\"GitHub Actions lint test status\"\u003e\u003c/a\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@middy/core\"\u003e\u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/@middy/core.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagephobia.com/result?p=@middy/core\"\u003e\u003cimg src=\"https://packagephobia.com/badge?p=@middy/core\" alt=\"npm install size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@middy/core\"\u003e\n  \u003cimg alt=\"npm weekly downloads\" src=\"https://img.shields.io/npm/dw/@middy/core.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@middy/core#provenance\"\u003e\n  \u003cimg alt=\"npm provenance\" src=\"https://img.shields.io/badge/provenance-Yes-brightgreen\"\u003e\u003c/a\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://scorecard.dev/viewer/?uri=github.com/middyjs/middy\"\u003e\u003cimg src=\"https://api.scorecard.dev/projects/github.com/middyjs/middy/badge\" alt=\"Open Source Security Foundation (OpenSSF) Scorecard\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://slsa.dev\"\u003e\u003cimg src=\"https://slsa.dev/images/gh-badge-level3.svg\" alt=\"SLSA 3\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/blob/main/docs/CODE_OF_CONDUCT.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://biomejs.dev\"\u003e\u003cimg alt=\"Checked with Biome\" src=\"https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat\u0026logo=biome\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://conventionalcommits.org\"\u003e\u003cimg alt=\"Conventional Commits\" src=\"https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits\u0026logoColor=white\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/middyjs/middy/blob/main/package.json#L32\"\u003e\n  \u003cimg alt=\"code coverage\" src=\"https://img.shields.io/badge/code%20coverage-100%25-brightgreen\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003eFull documentation: \u003ca href=\"https://middy.js.org\"\u003ehttps://middy.js.org\u003c/a\u003e \u0026middot; LLM-friendly: \u003ca href=\"https://middy.js.org/llms.txt\"\u003ellms.txt\u003c/a\u003e / \u003ca href=\"https://middy.js.org/llms-full.txt\"\u003ellms-full.txt\u003c/a\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n## What is Middy\n\nMiddy is a middleware engine for AWS Lambda on Node.js. It lets you keep your handler focused on business logic while attaching reusable steps for parsing, validation, auth, observability, error handling, and AWS service integration.\n\n- 52 official packages covering API Gateway, SQS, S3, DynamoDB, SNS, EventBridge, Kinesis, Kafka, WebSockets, and more\n- Built-in TypeScript types, Node.js \u003e= 24, ESM\n- Tiny core (only `@middy/util`, plus an optional peer dependency for durable functions), no AWS SDK in core\n- Routers for HTTP, WebSocket, and CloudFormation custom resources\n- First-class support for AWS Lambda response streaming and durable functions\n\n## Install\n\n```bash\nnpm install --save @middy/core\n# add only the middlewares you need\nnpm install --save @middy/http-json-body-parser @middy/http-error-handler @middy/validator\n```\n\n## Example\n\n```javascript\nimport middy from '@middy/core'\nimport httpJsonBodyParser from '@middy/http-json-body-parser'\nimport httpErrorHandler from '@middy/http-error-handler'\nimport validator from '@middy/validator'\nimport { transpileSchema } from '@middy/validator/transpile'\n\nconst schema = {\n  type: 'object',\n  properties: {\n    body: {\n      type: 'object',\n      properties: {\n        amount: { type: 'number' },\n        currency: { type: 'string' }\n      },\n      required: ['amount', 'currency']\n    }\n  }\n}\n\nconst lambdaHandler = async (event) =\u003e {\n  const { amount, currency } = event.body\n  // ... business logic\n  return { statusCode: 200, body: JSON.stringify({ ok: true, amount, currency }) }\n}\n\nexport const handler = middy()\n  .use(httpJsonBodyParser())\n  .use(validator({ eventSchema: transpileSchema(schema) }))\n  .use(httpErrorHandler())\n  .handler(lambdaHandler)\n```\n\n## When to use Middy\n\n**Use Middy for every production Lambda.** Production handlers always need the same set of non-functional concerns:\n\n- **Input validation** at every trust boundary (HTTP body / headers / query, event-source payloads).\n- **Structured logging** and consistent **error reporting**.\n- **Mapped HTTP error responses** instead of stack traces.\n- **Secrets and config** fetched from a secure store with caching + cold-start prefetch.\n- **CORS, security headers, response shaping** for HTTP APIs.\n- **Authentication** for anything exposed to the internet.\n- **Partial-batch failure handling** for SQS / Kinesis / DynamoDB Streams / Kafka / S3 Batch.\n- **Graceful pre-timeout responses** so clients see 408, not 504.\n\nMiddy is how you compose those without copy-pasting them into every handler. The \"tiny single handler\" exception is a trap - production handlers grow, and you do not want to add validation and error mapping under pressure later.\n\nSee [When to use Middy](https://middy.js.org/docs/intro/when-to-use), [Middy vs raw Lambda](https://middy.js.org/docs/compare/raw-lambda), and [Middy + AWS Lambda Powertools](https://middy.js.org/docs/compare/powertools).\n\n## Documentation\n\n- [Getting started](https://middy.js.org/docs/intro/getting-started)\n- [Official middlewares](https://middy.js.org/docs/middlewares/intro)\n- [Event types and event-source recipes](https://middy.js.org/docs/events/intro)\n- [Routers (HTTP, WebSocket, CloudFormation)](https://middy.js.org/docs/routers/http-router)\n- [Writing custom middlewares](https://middy.js.org/docs/writing-middlewares/intro)\n- [Recipes](https://middy.js.org/docs/recipes/jwt-auth)\n- [FAQ](https://middy.js.org/docs/faq)\n\n## Sponsors\n\n\u003ca href=\"https://fourtheorem.com?ref=github.com/middyjs/middy\"\u003e\u003cimg alt=\"fourTheorem\" src=\"https://raw.githubusercontent.com/middyjs/middy/main/websites/middy.js.org/static/img/sponsor/fourtheorem.svg\" style=\"max-width:50%\" width=\"380\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/aws?ref=github.com/middyjs/middy\"\u003e\u003cimg alt=\"Amazon Web Services Free and Open Source Software Fund (AWS FOSS Fund)\" src=\"https://raw.githubusercontent.com/middyjs/middy/main/websites/middy.js.org/static/img/sponsor/amazon-web-services.svg\" style=\"max-width:50%\" width=\"380\"/\u003e\u003c/a\u003e\n\n## License\n\nLicensed under [MIT License](LICENSE). Copyright (c) 2017-2026 [will Farrell](https://github.com/willfarrell), [Luciano Mammino](https://github.com/lmammino),  and [Middy contributors](https://github.com/middyjs/middy/graphs/contributors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiddyjs%2Fmiddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiddyjs%2Fmiddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiddyjs%2Fmiddy/lists"}