Package Exports
- lambda-multipart-parser
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambda-multipart-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
lambda-multipart-parser
npm install lambda-multipart-parser --saveIntroduction
This module will parse the multipart-form containing files and fields from the lambda event object.
Description
@param {event} - an event containing the multipart-form in the body
@return {object} - a JSON object containing array of files and fields, sample below.
{
files: [
{
filename: 'test.pdf',
content: <Buffer 25 50 6f 62 ... >,
contentType: 'application/pdf',
encoding: '7bit',
fieldname: 'uploadFile1'
}
],
field1: 'VALUE1',
field2: 'VALUE2',
}Usage
const parser = require('lambda-multipart-parser');
const result = await parser.parse(event);
console.log(result.files);Test
npm run test