https://github.com/eomm/sqs-json-body-parser

Middyjs middleware to parse your AWS SQS events

https://github.com/eomm/sqs-json-body-parser

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

aws aws-lambda hacktoberfest javascript json lambda middleware middy parsing sqs
Last synced: 6 months ago · JSON representation

Repository

Middyjs middleware to parse your AWS SQS events

Basic Info
  • Host: GitHub
  • Owner: Eomm
  • License: mit
  • Language: JavaScript
  • Default Branch: main
  • Homepage:
  • Size: 12.7 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 3
Topics
aws aws-lambda hacktoberfest javascript json lambda middleware middy parsing sqs
Created about 5 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

Middy sqs-json-body-parser middleware

Build Status JavaScript Style Guide

🛵 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: true
  • attachField (string): the name of the attached field. Default: jsonBody
  • secureJson (json): customize the options passed to secure-json-parse. If null the JSON.parse will 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

Senior Dev @nearform | Newbie Italian Speaker | Self-learner

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 8
  • Total Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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
dependencies (16) javascript (16)

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

  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 17 Last month
Rankings
Dependent packages count: 16.2%
Forks count: 17.4%
Stargazers count: 18.8%
Average: 19.6%
Downloads: 20.1%
Dependent repos count: 25.3%
Maintainers (1)
Funding
  • https://github.com/Eomm/sqs-json-body-parser?sponsor=1
Last synced: 6 months ago

Dependencies

package.json npm
  • @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
.github/workflows/ci.yml actions