1.0.21 • Published 9 months ago

elegant-tools v1.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

A simple toolset for Node.js / TypeScript AWS lambda development

** Context-aware logging It will follow async calls and add values added to context to every log entry

import { EventBridgeEvent } from "aws-lambda";
import { createHandler, getContext } from "elegant-tools";

export const handler = createHandler(async (event: EventBridgeEvent<string, any>) => {
  const { logger } = getContext();
  if (event["detail-type"] !== "supported-event-type") {
    logger.info(`Ignoring event: ${event["detail-type"]}`);
    return;
  }

  const input = SupportedEventSchema.parse(event.detail);
  logger.patchContext({
    correlationId: input.metadata["correlation-id"],
    ...
  });

  return await someDownstreamService(input);
});
1.0.21

9 months ago

1.0.20

9 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.17

9 months ago

1.0.16

9 months ago

1.0.11

10 months ago

1.0.15

9 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago