Middy s3-key-normalizer middleware
S3 key normalizer middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda
Normalizes key names in s3 events.
S3 events like S3 PUT and S3 DELETE will contain in the event a list of the files that were affected by the change.
In this list the file keys are encoded in a very peculiar way (urlencoded and
space characters replaced by a
+). Very often you will use the
key directly to perform operations on the file using the AWS S3 SDK, in which case it's very easy to forget to decode the key correctly.
This middleware, once attached, makes sure that every S3 event has the file keys properly normalized.
To install this middleware you can use NPM:
npm install --save @middy/s3-key-normalizer
This middleware does not have any option
const middy =const s3KeyNormalizer =const handler =handler