https://github.com/eomm/sqs-json-body-parser
Middyjs middleware to parse your AWS SQS events
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.4%) to scientific vocabulary
Keywords
Repository
Middyjs middleware to parse your AWS SQS events
Basic Info
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
- Releases: 3
Topics
Metadata Files
README.md
Middy sqs-json-body-parser middleware
🛵 middyjs middleware to parse your AWS SQS events' body!
This middleware will add to the SQS message an additional field with the parsed body.
If the event is not an SQS event, it will be ignored.
Install
js
npm i sqs-json-body-parser
Options
throwOnFail(boolean): define if the middleware should ignore errors when parsing the body string. Default:trueattachField(string): the name of the attached field. Default:jsonBodysecureJson(json): customize theoptionspassed tosecure-json-parse. If null theJSON.parsewill be used instead to parse the body. Default: null
⚠ secureJson may impact your Lambda performance! Use it only if the body input is not sanitized.
Usage
```js const middy = require('@middy/core') const sqsJsonBodyParser = require('sqs-json-body-parser')
const handler = middy((event, context, cb) => { cb(null, event.Records) })
handler.use(sqsJsonBodyParser({ throwOnFail: false }))
// invokes the handler const event = { "Records": [ { "messageId": "11d6ee51-4cc7-4302-9e22-7cd8afdaadf5", "receiptHandle": "AQEBBX8nesZEXmkhsmZeyIE8iQAMig7qw...", "body": "{\"test\": \"foo\"}", "attributes": { "ApproximateReceiveCount": "1", "SentTimestamp": "1573251510774", "SequenceNumber": "18849496460467696128", "MessageGroupId": "1", "SenderId": "AIDAIO23YVJENQZJOL4VO", "MessageDeduplicationId": "1", "ApproximateFirstReceiveTimestamp": "1573251510774" }, "messageAttributes": {}, "md5OfBody": "e4e68fb7bd0e697a0ae8f1bb342846b3", "eventSource": "aws:sqs", "eventSourceARN": "arn:aws:sqs:us-east-2:123456789012:fifo.fifo", "awsRegion": "us-east-2" } ] }
handler(event, {}, (_, records) => { expect(records[0].jsonBody).toEqual({ test: 'foo' }) }) ```
License
Licensed under MIT.
Owner
- Name: Manuel Spigolon
- Login: Eomm
- Kind: user
- Location: Italy
- Company: @nearform
- Website: https://backend.cafe/
- Twitter: ManuEomm
- Repositories: 282
- Profile: https://github.com/Eomm
Senior Dev @nearform | Newbie Italian Speaker | Self-learner
GitHub Events
Total
Last Year
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Manuel Spigolon | b****9@g****m | 8 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 18
- Average time to close issues: N/A
- Average time to close pull requests: 7 days
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.83
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 16
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (16)
- Eomm (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 17 last-month
- Total dependent packages: 1
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
npmjs.org: sqs-json-body-parser
Middyjs middleware to parse your AWS SQS events
- Homepage: https://github.com/Eomm/sqs-json-body-parser#readme
- License: MIT
-
Latest release: 1.1.0
published over 3 years ago
Rankings
Maintainers (1)
Funding
- https://github.com/Eomm/sqs-json-body-parser?sponsor=1
Dependencies
- @middy/core ^1.4.0 development
- rfdc ^1.1.4 development
- standard ^16.0.3 development
- tap ^14.11.0 development
- secure-json-parse ^2.1.0