0.0.1 • Published 7 years ago
bluedot-event-emitter v0.0.1
Bluedot event bus emitter library
This library publishes messages to bluedot's event bus
Prerequisites
Install NodeJs
brew install nodeInstall Typescript
npm install typescript -gInstall Typescript lint
npm install tslintInstall dependencies:
npm installTests
Includes
- Joi (https://github.com/hapijs/joi) for object schema validation and
- Rosie (https://github.com/rosiejs/rosie) for test events generation
To run:
npm testTo check coverage:
npm run test:coverage-checkBuild Steps
This starter kit uses Rollup (https://rollupjs.org/guide/en) for module bundling
Build library. NOTE: Update test coverage requirements
npm run buildThis will build the
Publish library
npm publishThis 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-1Bare 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-1Library 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.
0.0.1
7 years ago