Skip to content

Commit

Permalink
docs: add readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Apr 2, 2019
1 parent 6ff948c commit c2ec2f6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# aws-sns-message-attributes [![CircleCI](https://circleci.com/gh/shelfio/aws-sns-message-attributes/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-sns-message-attributes/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/aws-sns-message-attributes.svg)](https://www.npmjs.com/package/@shelf/aws-sns-message-attributes)

> Transform JSON into AWS SNS message attributes format. See [1](https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html), [2](https://docs.aws.amazon.com/sns/latest/dg/sns-subscription-filter-policies.html)
## Install

```
$ yarn add @shelf/aws-sns-message-attributes
```

## Usage

```js
const {transformMessageAttributes} = require('@shelf/aws-sns-message-attributes');

transformMessageAttributes({
string: 'hello',
array: ['hello', 'world'],
number: 1
});

/*
{
string: {DataType: 'String', StringValue: 'hello'},
array: {DataType: 'String.Array', StringValue: '["hello","world"]'},
number: {DataType: 'Number', StringValue: 1}
}
*/
```

## License

MIT © [Shelf](https://shelf.io)

0 comments on commit c2ec2f6

Please sign in to comment.