Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

emittableevent

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emittableevent

EmittableEvent is an opinionated abstraction class for generating rich EventBridge events.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
449
increased by146.7%
Maintainers
1
Weekly downloads
 
Created
Source

EmittableEvent

EmittableEvent is an opinionated abstraction class for generating rich EventBridge events.

// Your own event class
class MyEvent extends EmittableEvent {
  // Do something here if you want, else just leave it as is!
}

// Convenience utility to produce required static metadata
const getMetadataConfig = (version = 1): MetadataConfigInput => {
  return {
    version,
    eventType: 'DomainEvent',
    domain: 'MyDomain',
    system: 'MySystem',
    service: 'MyService',
    team: 'MyTeam',
    hostPlatform: 'aws',
    owner: 'Sam Person',
    jurisdiction: 'eu'
  };
};

// Input for actually creating the event
const eventInput = {
  eventName: 'Created',
  eventBusName: 'MyEventBus',
  data: {
    something: 'some value here if you want'
  },
  metadataConfig: getMetadataConfig()
};

// Create the event
const event = new CreatedEvent(eventInput, requestContext);

// ...and here's the actual full body of the event
console.log(event.get());

Keywords

FAQs

Package last updated on 26 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc