{"id":19274046,"url":"https://github.com/sbstjn/sqs-object","last_synced_at":"2026-05-17T03:13:14.911Z","repository":{"id":137671442,"uuid":"83847657","full_name":"sbstjn/sqs-object","owner":"sbstjn","description":"Convert JavaScript objects to SQS Meta Attributes","archived":false,"fork":false,"pushed_at":"2017-03-04T13:43:46.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T14:30:13.780Z","etag":null,"topics":["aws","mapping","object","sqs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstjn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-03T22:34:33.000Z","updated_at":"2017-10-31T20:51:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6eece71-caae-4ec9-9fba-14a1b51044f7","html_url":"https://github.com/sbstjn/sqs-object","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fsqs-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fsqs-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fsqs-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fsqs-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstjn","download_url":"https://codeload.github.com/sbstjn/sqs-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240378873,"owners_count":19792039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","mapping","object","sqs"],"created_at":"2024-11-09T20:44:55.635Z","updated_at":"2026-05-17T03:13:09.880Z","avatar_url":"https://github.com/sbstjn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqs-object\n\n[![npm](https://img.shields.io/npm/v/sqs-object.svg)](https://www.npmjs.com/package/sqs-object)\n[![license](https://img.shields.io/github/license/sbstjn/sqs-object.svg)](https://github.com/sbstjn/sqs-object/blob/master/LICENSE.md)\n[![CircleCI](https://img.shields.io/circleci/project/github/sbstjn/sqs-object/master.svg)](https://circleci.com/gh/sbstjn/sqs-object)\n\nConvert **JavaScript** objects to **SQS Meta** attributes as *vice verse*.\n\n## Installation\n\n```bash\n$ \u003e npm install sqs-object --save\n```\n\n## Usage\n\n```js\nconst sqsObject = require('sqs-object');\n```\n\n## Mapping\n\nFirst define a mapping between the JavaScript object and the SQS Meta Attributes like this:\n\n```js\nconst mapping = [\n  {\n    objectKey: 'id',\n    sqsKey: 'ID',\n    sqsType: 'Number'\n  },\n  {\n    objectKey: 'name',\n    sqsKey: 'Name',\n    sqsType: 'String'\n  },\n  {\n    objectKey: 'age',\n    sqsKey: 'Age',\n    sqsType: 'Number'\n  }\n];\n```\n\n## Object to Meta Attributes\n\n```js\nconst meta = sqsObject.Meta({\n  id: 12,\n  name: 'Paul',\n  age: 45\n}, mapping);\n```\n\n```json\n{\n  \"ID\": {\n    \"DataType\": \"Number\",\n    \"StringValue\": \"12\"\n  },\n  \"Name\": {\n    \"DataType\": \"String\",\n    \"StringValue\": \"Paul\"\n  },\n  \"Age\": {\n    \"DataType\": \"Number\",\n    \"StringValue\": \"45\"\n  }\n}\n```\n\n## Meta Attributes to Object\n\n```js\nconst object = sqsObject.Object({\n  ID: {\n    DataType: 'Number',\n    StringValue: '12'\n  },\n  Name: {\n    DataType: 'String',\n    StringValue: 'Paul'\n  },\n  Age: {\n    DataType: 'Number',\n    StringValue: '45'\n  }\n}, mapping);\n```\n\n```json\n{\n  \"id\": 12,\n  \"name\": \"Paul\",\n  \"age\": 45\n}\n```\n\n## License\n\nFeel free to use the code, it's released using the [MIT license](https://github.com/sbstjn/sqs-object/blob/master/LICENSE.md).\n\n## Contributors\n\n- [Sebastian Müller](https://sbstjn.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fsqs-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstjn%2Fsqs-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fsqs-object/lists"}