Bluedot event bus emitter library
This library publishes messages to bluedot's event bus
Prerequisites
Install NodeJs
brew install node
Install Typescript
npm install typescript -g
Install Typescript lint
npm install tslint
Install dependencies:
npm install
Tests
Includes
To run:
npm test
To check coverage:
npm run test:coverage-check
Build Steps
This starter kit uses Rollup (https://rollupjs.org/guide/en) for module bundling
Build library. NOTE: Update test coverage requirements
npm run build
This will build the
Publish library
npm publish
This will publish a CommonJS module and a ES module in the ./dist
directory
Library configuration
Lambda:
// dont need to do anything. cloudformation will need to add permission policy provided
- Fn::ImportValue:
!Sub '${EventBusStack}-AllowEmitterPolicyARN' // EventBusStack=bluedot-event-bus-dev-1
Bare metal:
include the following in your environment's variable:
AWS_ACCESS_KEY_ID=AKIAINVCEZNEUSKZLE2A
AWS_SECRET_ACCESS_KEY=iELkjPIGh26KWLBEKbTK5M5DiehEjSQJKQv7snmH
REGION=ap-southeast-2
TOPIC_ARN=arn:aws:sns:ap-southeast-2:791031460737:bluedot-config-events-dev-1
Library Usage
CommonJS:
const Test = require('typescript-library-starter-kit').Test
Test.test(payload)
ES:
import { Test } from 'typescript-library-starter-kit'
Test.test(payload)
License
This project is released under The Unlicense, your free to copy this and do what you like.