Gathering detailed insights and metrics for @tinyanvil/http-multipart-body-parser
Gathering detailed insights and metrics for @tinyanvil/http-multipart-body-parser
Gathering detailed insights and metrics for @tinyanvil/http-multipart-body-parser
Gathering detailed insights and metrics for @tinyanvil/http-multipart-body-parser
🛵 The stylish Node.js middleware engine for AWS Lambda 🛵
npm install @tinyanvil/http-multipart-body-parser
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (88.23%)
TypeScript (11.3%)
CSS (0.46%)
Shell (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3,833 Stars
2,476 Commits
388 Forks
35 Watchers
18 Branches
201 Contributors
Updated on Jul 10, 2025
Latest Version
1.0.1
Package Id
@tinyanvil/http-multipart-body-parser@1.0.1
Unpacked Size
14.62 kB
Size
4.32 kB
File Count
6
NPM Version
6.14.4
Node Version
12.16.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
1
2
HTTP json body parser middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda
Automatically parses HTTP requests with content type multipart/form-data
and converts the body into an
object. Also handles gracefully broken JSON as UnprocessableEntity (422 errors)
if used in combination with httpErrorHandler
.
It can also be used in combination with validator so that the content can be validated.
Note: by default this is going to parse only events that contain the header Content-Type
(or content-type
) set to multipart/form-data
. If you want to support different casing for the header name (e.g. Content-type
) then you should use the httpHeaderNormalizer
middleware before this middleware.
To install this middleware you can use NPM:
1npm install --save @middy/http-multipart-body-parser
busboy
(object) (optional): defaults to {}
and it can be used to pass extraparameters to the internal busboy
instance at creation time. Checkout the official documentation for more information on the supported options.Note: this middleware will buffer all the data as it is processed internally by busboy
, so, if you are using this approach to parse significantly big volumes of data, keep in mind that all the data will be allocated in memory. This is somewhat inevitable with Lambdas (as the data is already encoded into the JSON in memory as Base64), but it's good to keep this in mind and evaluate the impact on you application.
If you really have to deal with big files, then you might also want to consider to allowing your users to directly upload files to S3
1const middy = require('@middy/core') 2const { httpMultipartBodyParser } = require('@middy/http-multipart-body-parser') 3const handler = middy((event, context, cb) => { 4 cb(null, {}) 5}) 6handler.use(httpMultipartBodyParser()) 7// invokes the handler 8const event = { 9 headers: { 10 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryppsQEwf2BVJeCe0M' 11 }, 12 body: 'LS0tLS0tV2ViS2l0Rm9ybUJvdW5kYXJ5cHBzUUV3ZjJCVkplQ2UwTQ0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJmb28iDQoNCmJhcg0KLS0tLS0tV2ViS2l0Rm9ybUJvdW5kYXJ5cHBzUUV3ZjJCVkplQ2UwTS0t', 13 isBase64Encoded: true 14} 15handler(event, {}, (_, body) => { 16 expect(body).toEqual({ foo: 'bar' }) 17})
For more documentation and examples, refers to the main Middy monorepo on GitHub or Middy official website.
Everyone is very welcome to contribute to this repository. Feel free to raise issues or to submit Pull Requests.
Licensed under MIT License. Copyright (c) 2017-2018 Luciano Mammino and the Middy team.
No vulnerabilities found.
Reason
30 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
update tool detected
Details
Reason
security policy file detected
Details
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
packaging workflow detected
Details
Reason
license file detected
Details
Reason
project is fuzzed
Details
Reason
branch protection is fully enabled on development and all release branches
Details
Reason
SAST tool is run on all commits
Details
Reason
10 out of 10 merged PRs checked by a CI test -- score normalized to 10
Reason
project has 31 contributing companies or organizations
Details
Reason
dependency not pinned by hash detected -- score normalized to 9
Details
Reason
2 existing vulnerabilities detected
Details
Reason
badge detected: Silver
Score
Last Scanned on 2025-07-06T15:30:39Z
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More