Socket
Socket
Sign inDemoInstall

@aws-lambda-powertools/commons

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-lambda-powertools/commons - npm Package Compare versions

Comparing version 1.14.0 to 1.14.1

5

lib/awsSdk/userAgentMiddleware.d.ts
import type { MiddlewareArgsLike } from '../types/awsSdk';
/**
* @internal
* returns a middleware function for the MiddlewareStack, that can be used for the SDK clients
* @param feature
*/
declare const customUserAgentMiddleware: (feature: string) => <T extends MiddlewareArgsLike>(next: (arg0: T) => Promise<T>) => (args: T) => Promise<T>;

@@ -3,0 +8,0 @@ declare const addUserAgentMiddleware: (client: unknown, feature: string) => void;

29

lib/awsSdk/userAgentMiddleware.js

@@ -6,2 +6,5 @@ "use strict";

const utils_1 = require("./utils");
/**
* @internal
*/
const EXEC_ENV = process.env.AWS_EXECUTION_ENV || 'NA';

@@ -14,2 +17,7 @@ const middlewareOptions = {

};
/**
* @internal
* returns a middleware function for the MiddlewareStack, that can be used for the SDK clients
* @param feature
*/
const customUserAgentMiddleware = (feature) => {

@@ -23,8 +31,19 @@ return (next) => async (args) => {

exports.customUserAgentMiddleware = customUserAgentMiddleware;
/**
* @internal
* Checks if the middleware stack already has the Powertools UA middleware
*/
const hasPowertools = (middlewareStack) => {
let found = false;
for (const middleware of middlewareStack) {
if (middleware.includes('addPowertoolsToUserAgent')) {
found = true;
}
}
return found;
};
const addUserAgentMiddleware = (client, feature) => {
try {
if ((0, utils_1.isSdkClient)(client)) {
if (client.middlewareStack
.identify()
.includes('addPowertoolsToUserAgent: POWERTOOLS,USER_AGENT')) {
if (hasPowertools(client.middlewareStack.identify())) {
return;

@@ -38,6 +57,6 @@ }

}
catch (e) {
console.warn('Failed to add user agent middleware', e);
catch (error) {
console.warn('Failed to add user agent middleware', error);
}
};
exports.addUserAgentMiddleware = addUserAgentMiddleware;
import { SdkClient } from '../types/awsSdk';
/**
* @internal
* Type guard to check if the client provided is a valid AWS SDK v3 client
*/
declare const isSdkClient: (client: unknown) => client is SdkClient;
export { isSdkClient };
//# sourceMappingURL=utils.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSdkClient = void 0;
/**
* @internal
* Type guard to check if the client provided is a valid AWS SDK v3 client
*/
const isSdkClient = (client) => typeof client === 'object' &&

@@ -5,0 +9,0 @@ client !== null &&

@@ -0,5 +1,41 @@

/**
* Abstract class ConfigService
*
* This class defines common methods and variables that can be set by the developer
* in the runtime.
*
* @class
* @abstract
*/
declare abstract class ConfigService {
/**
* It returns the value of an environment variable that has given name.
*
* @param {string} name
* @returns {string}
*/
abstract get(name: string): string;
/**
* It returns the value of the POWERTOOLS_SERVICE_NAME environment variable.
*
* @returns {string}
*/
abstract getServiceName(): string;
/**
* It returns the value of the _X_AMZN_TRACE_ID environment variable.
*
* The AWS X-Ray Trace data available in the environment variable has this format:
* `Root=1-5759e988-bd862e3fe1be46a994272793;Parent=557abcec3ee5a047;Sampled=1`,
*
* The actual Trace ID is: `1-5759e988-bd862e3fe1be46a994272793`.
*
* @returns {string|undefined}
*/
abstract getXrayTraceId(): string | undefined;
/**
* It returns true if the string value represents a boolean true value.
*
* @param {string} value
* @returns boolean
*/
abstract isValueTrue(value: string): boolean;

@@ -6,0 +42,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigService = void 0;
/**
* Abstract class ConfigService
*
* This class defines common methods and variables that can be set by the developer
* in the runtime.
*
* @class
* @abstract
*/
class ConfigService {
}
exports.ConfigService = ConfigService;
import { ConfigService } from './ConfigService';
/**
* Class EnvironmentVariablesService
*
* This class is used to return environment variables that are available in the runtime of
* the current Lambda invocation.
* These variables can be a mix of runtime environment variables set by AWS and
* variables that can be set by the developer additionally.
*
* @class
* @extends {ConfigService}
* @see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables
*/
declare class EnvironmentVariablesService extends ConfigService {
/**
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables
* @protected
*/
protected serviceNameVariable: string;
private xRayTraceIdVariable;
/**
* It returns the value of an environment variable that has given name.
*
* @param {string} name
* @returns {string}
*/
get(name: string): string;
/**
* It returns the value of the POWERTOOLS_SERVICE_NAME environment variable.
*
* @returns {string}
*/
getServiceName(): string;
/**
* It returns the value of the _X_AMZN_TRACE_ID environment variable.
*
* The AWS X-Ray Trace data available in the environment variable has this format:
* `Root=1-5759e988-bd862e3fe1be46a994272793;Parent=557abcec3ee5a047;Sampled=1`,
*
* The actual Trace ID is: `1-5759e988-bd862e3fe1be46a994272793`.
*
* @returns {string}
*/
getXrayTraceId(): string | undefined;
/**
* It returns true if the Sampled flag is set in the _X_AMZN_TRACE_ID environment variable.
*
* The AWS X-Ray Trace data available in the environment variable has this format:
* `Root=1-5759e988-bd862e3fe1be46a994272793;Parent=557abcec3ee5a047;Sampled=1`,
*
* @returns {boolean}
*/
getXrayTraceSampled(): boolean;
/**
* It returns true if the string value represents a boolean true value.
*
* @param {string} value
* @returns boolean
*/
isValueTrue(value: string): boolean;
/**
* It parses the key/value data present in the _X_AMZN_TRACE_ID environment variable
* and returns it as an object when available.
*/
private getXrayTraceData;

@@ -11,0 +67,0 @@ }

@@ -5,14 +5,53 @@ "use strict";

const ConfigService_1 = require("./ConfigService");
/**
* Class EnvironmentVariablesService
*
* This class is used to return environment variables that are available in the runtime of
* the current Lambda invocation.
* These variables can be a mix of runtime environment variables set by AWS and
* variables that can be set by the developer additionally.
*
* @class
* @extends {ConfigService}
* @see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables
*/
class EnvironmentVariablesService extends ConfigService_1.ConfigService {
constructor() {
super(...arguments);
/**
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables
* @protected
*/
this.serviceNameVariable = 'POWERTOOLS_SERVICE_NAME';
// Reserved environment variables
this.xRayTraceIdVariable = '_X_AMZN_TRACE_ID';
}
/**
* It returns the value of an environment variable that has given name.
*
* @param {string} name
* @returns {string}
*/
get(name) {
return process.env[name]?.trim() || '';
}
/**
* It returns the value of the POWERTOOLS_SERVICE_NAME environment variable.
*
* @returns {string}
*/
getServiceName() {
return this.get(this.serviceNameVariable);
}
/**
* It returns the value of the _X_AMZN_TRACE_ID environment variable.
*
* The AWS X-Ray Trace data available in the environment variable has this format:
* `Root=1-5759e988-bd862e3fe1be46a994272793;Parent=557abcec3ee5a047;Sampled=1`,
*
* The actual Trace ID is: `1-5759e988-bd862e3fe1be46a994272793`.
*
* @returns {string}
*/
getXrayTraceId() {

@@ -22,2 +61,10 @@ const xRayTraceData = this.getXrayTraceData();

}
/**
* It returns true if the Sampled flag is set in the _X_AMZN_TRACE_ID environment variable.
*
* The AWS X-Ray Trace data available in the environment variable has this format:
* `Root=1-5759e988-bd862e3fe1be46a994272793;Parent=557abcec3ee5a047;Sampled=1`,
*
* @returns {boolean}
*/
getXrayTraceSampled() {

@@ -27,2 +74,8 @@ const xRayTraceData = this.getXrayTraceData();

}
/**
* It returns true if the string value represents a boolean true value.
*
* @param {string} value
* @returns boolean
*/
isValueTrue(value) {

@@ -32,2 +85,6 @@ const truthyValues = ['1', 'y', 'yes', 't', 'true', 'on'];

}
/**
* It parses the key/value data present in the _X_AMZN_TRACE_ID environment variable
* and returns it as an object when available.
*/
getXrayTraceData() {

@@ -34,0 +91,0 @@ const xRayTraceEnv = this.get(this.xRayTraceIdVariable);

import type { MiddyLikeRequest } from '../types/middy';
/**
* Function used to cleanup Powertools for AWS resources when a Middy
* middleware [returns early](https://middy.js.org/docs/intro/early-interrupt)
* and terminates the middleware chain.
*
* When a middleware returns early, all the middleware lifecycle functions
* that come after it are not executed. This means that if a middleware
* was relying on certain logic to be run during the `after` or `onError`
* lifecycle functions, that logic will not be executed.
*
* This is the case for the middlewares that are part of Powertools for AWS
* which rely on these lifecycle functions to perform cleanup operations
* like closing the current segment in the tracer or flushing any stored
* metrics.
*
* When authoring a middleware that might return early, you can use this
* function to cleanup Powertools resources. This function will check if
* any cleanup function is present in the `request.internal` object and
* execute it.
*
* @example
* ```typescript
* import middy from '@middy/core';
* import { cleanupMiddlewares } from '@aws-lambda-powertools/commons/lib/middleware';
*
* // Example middleware that returns early
* const myCustomMiddleware = (): middy.MiddlewareObj => {
* const before = async (request: middy.Request): Promise<undefined | string> => {
* // If the request is a GET, return early (as an example)
* if (request.event.httpMethod === 'GET') {
* // Cleanup Powertools resources
* await cleanupMiddlewares(request);
* // Then return early
* return 'GET method not supported';
* }
* };
*
* return {
* before,
* };
* };
* ```
*
* @param request - The Middy request object
* @param options - An optional object that can be used to pass options to the function
*/
declare const cleanupMiddlewares: (request: MiddyLikeRequest) => Promise<void>;
export { cleanupMiddlewares };
//# sourceMappingURL=cleanupMiddlewares.d.ts.map

@@ -5,5 +5,52 @@ "use strict";

const constants_1 = require("./constants");
// Typeguard to assert that an object is of Function type
const isFunction = (obj) => {
return typeof obj === 'function';
};
/**
* Function used to cleanup Powertools for AWS resources when a Middy
* middleware [returns early](https://middy.js.org/docs/intro/early-interrupt)
* and terminates the middleware chain.
*
* When a middleware returns early, all the middleware lifecycle functions
* that come after it are not executed. This means that if a middleware
* was relying on certain logic to be run during the `after` or `onError`
* lifecycle functions, that logic will not be executed.
*
* This is the case for the middlewares that are part of Powertools for AWS
* which rely on these lifecycle functions to perform cleanup operations
* like closing the current segment in the tracer or flushing any stored
* metrics.
*
* When authoring a middleware that might return early, you can use this
* function to cleanup Powertools resources. This function will check if
* any cleanup function is present in the `request.internal` object and
* execute it.
*
* @example
* ```typescript
* import middy from '@middy/core';
* import { cleanupMiddlewares } from '@aws-lambda-powertools/commons/lib/middleware';
*
* // Example middleware that returns early
* const myCustomMiddleware = (): middy.MiddlewareObj => {
* const before = async (request: middy.Request): Promise<undefined | string> => {
* // If the request is a GET, return early (as an example)
* if (request.event.httpMethod === 'GET') {
* // Cleanup Powertools resources
* await cleanupMiddlewares(request);
* // Then return early
* return 'GET method not supported';
* }
* };
*
* return {
* before,
* };
* };
* ```
*
* @param request - The Middy request object
* @param options - An optional object that can be used to pass options to the function
*/
const cleanupMiddlewares = async (request) => {

@@ -10,0 +57,0 @@ const cleanupFunctionNames = [

@@ -0,1 +1,6 @@

/**
* These constants are used to store cleanup functions in Middy's `request.internal` object.
* They are used by the `cleanupPowertools` function to check if any cleanup function
* is present and execute it.
*/
declare const PREFIX = "powertools-for-aws";

@@ -2,0 +7,0 @@ declare const TRACER_KEY = "powertools-for-aws.tracer";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IDEMPOTENCY_KEY = exports.LOGGER_KEY = exports.METRICS_KEY = exports.TRACER_KEY = exports.PREFIX = void 0;
/**
* These constants are used to store cleanup functions in Middy's `request.internal` object.
* They are used by the `cleanupPowertools` function to check if any cleanup function
* is present and execute it.
*/
const PREFIX = 'powertools-for-aws';

@@ -5,0 +10,0 @@ exports.PREFIX = PREFIX;

@@ -0,1 +1,5 @@

/**
* @internal
* Minimal interface for an AWS SDK v3 client
*/
interface SdkClient {

@@ -11,2 +15,6 @@ send: (args: unknown) => Promise<unknown>;

}
/**
* @internal
* Minimal type for the arguments passed to a middleware function
*/
type MiddlewareArgsLike = {

@@ -13,0 +21,0 @@ request: {

import type { Context } from 'aws-lambda';
/**
* We need to define these types and interfaces here because we can't import them from @middy/core.
* Importing them from @middy/core would introduce a dependency on @middy/core, which we don't want
* because we want to keep it as an optional dependency. Those users who don't use the Powertools for AWS Lambda (TypeScript) middleware
* and use `tsc` to compile their code will get an error if we import from @middy/core, see #1068.
* Given that we use a subset of the @middy/core types, we can define them here and avoid the dependency.
*/
type Request<TEvent = unknown, TResult = unknown, TErr = Error, TContext extends Context = Context> = {

@@ -26,4 +33,9 @@ event: TEvent;

};
/**
* Cleanup function that is used to cleanup resources when a middleware returns early.
* Each Powertools for AWS middleware that needs to perform cleanup operations will
* store a cleanup function with this signature in the `request.internal` object.
*/
type CleanupFunction = (request: MiddyLikeRequest) => Promise<void>;
export { MiddlewareLikeObj, MiddyLikeRequest, CleanupFunction };
//# sourceMappingURL=middy.d.ts.map

@@ -0,4 +1,24 @@

/**
* Returns true if the passed value is a record (object).
*
* @param value
*/
declare const isRecord: (value: unknown) => value is Record<string, unknown>;
/**
* Returns true if the passed value is truthy.
*
* @param value
*/
declare const isTruthy: (value: unknown) => boolean;
/**
* Returns true if the passed value is null or undefined.
*
* @param value
*/
declare const isNullOrUndefined: (value: unknown) => value is null | undefined;
/**
* Returns true if the passed value is a string.
* @param value
* @returns
*/
declare const isString: (value: unknown) => value is string;

@@ -5,0 +25,0 @@ export { isRecord, isString, isTruthy, isNullOrUndefined };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNullOrUndefined = exports.isTruthy = exports.isString = exports.isRecord = void 0;
/**
* Returns true if the passed value is a record (object).
*
* @param value
*/
const isRecord = (value) => {

@@ -9,2 +14,7 @@ return (Object.prototype.toString.call(value) === '[object Object]' &&

exports.isRecord = isRecord;
/**
* Returns true if the passed value is truthy.
*
* @param value
*/
const isTruthy = (value) => {

@@ -31,2 +41,7 @@ if (typeof value === 'string') {

exports.isTruthy = isTruthy;
/**
* Returns true if the passed value is null or undefined.
*
* @param value
*/
const isNullOrUndefined = (value) => {

@@ -36,2 +51,7 @@ return Object.is(value, null) || Object.is(value, undefined);

exports.isNullOrUndefined = isNullOrUndefined;
/**
* Returns true if the passed value is a string.
* @param value
* @returns
*/
const isString = (value) => {

@@ -38,0 +58,0 @@ return typeof value === 'string';

@@ -0,1 +1,58 @@

/**
* ## Intro
* Utility is a base class that other Powertools for AWS Lambda (TypeScript) utilites can extend to inherit shared logic.
*
*
* ## Key features
* * Cold Start heuristic to determine if the current
*
* ## Usage
*
* ### Cold Start
*
* Cold start is a term commonly used to describe the `Init` phase of a Lambda function. In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the functionโ€™s initialization code (the code outside the main handler). The Init phase happens either during the first invocation, or in advance of function invocations if you have enabled provisioned concurrency.
*
* To learn more about the Lambda execution environment lifecycle, see the [Execution environment section](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html) of the AWS Lambda documentation.
*
* As a Powertools for AWS Lambda (TypeScript) user you probably won't be using this class directly, in fact if you use other Powertools for AWS utilities the cold start heuristic found here is already used to:
* * Add a `coldStart` key to the structured logs when injecting context information in `Logger`
* * Emit a metric during a cold start function invocation in `Metrics`
* * Annotate the invocation segment with a `coldStart` key in `Tracer`
*
* If you want to use this logic in your own utilities, `Utility` provides two methods:
*
* #### `getColdStart()`
*
* Since the `Utility` class is instantiated outside of the Lambda handler it will persist across invocations of the same execution environment. This means that if you call `getColdStart()` multiple times, it will return `true` during the first invocation, and `false` afterwards.
*
* @example
* ```typescript
* import { Utility } from '@aws-lambda-powertools/commons';
*
* const utility = new Utility();
*
* export const handler = async (_event: any, _context: any) => {
* utility.getColdStart();
* };
* ```
*
* #### `isColdStart()`
*
* This method is an alias of `getColdStart()` and is exposed for convenience and better readability in certain usages.
*
* @example
* ```typescript
* import { Utility } from '@aws-lambda-powertools/commons';
*
* const utility = new Utility();
*
* export const handler = async (_event: any, _context: any) => {
* if (utility.isColdStart()) {
* // do something, this block is only executed on the first invocation of the function
* } else {
* // do something else, this block gets executed on all subsequent invocations
* }
* };
* ```
*/
export declare class Utility {

@@ -7,4 +64,10 @@ private coldStart;

protected getDefaultServiceName(): string;
/**
* Validate that the service name provided is valid.
* Used internally during initialization.
*
* @param serviceName - Service name to validate
*/
protected isValidServiceName(serviceName?: string): boolean;
}
//# sourceMappingURL=Utility.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Utility = void 0;
/**
* ## Intro
* Utility is a base class that other Powertools for AWS Lambda (TypeScript) utilites can extend to inherit shared logic.
*
*
* ## Key features
* * Cold Start heuristic to determine if the current
*
* ## Usage
*
* ### Cold Start
*
* Cold start is a term commonly used to describe the `Init` phase of a Lambda function. In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the functionโ€™s initialization code (the code outside the main handler). The Init phase happens either during the first invocation, or in advance of function invocations if you have enabled provisioned concurrency.
*
* To learn more about the Lambda execution environment lifecycle, see the [Execution environment section](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html) of the AWS Lambda documentation.
*
* As a Powertools for AWS Lambda (TypeScript) user you probably won't be using this class directly, in fact if you use other Powertools for AWS utilities the cold start heuristic found here is already used to:
* * Add a `coldStart` key to the structured logs when injecting context information in `Logger`
* * Emit a metric during a cold start function invocation in `Metrics`
* * Annotate the invocation segment with a `coldStart` key in `Tracer`
*
* If you want to use this logic in your own utilities, `Utility` provides two methods:
*
* #### `getColdStart()`
*
* Since the `Utility` class is instantiated outside of the Lambda handler it will persist across invocations of the same execution environment. This means that if you call `getColdStart()` multiple times, it will return `true` during the first invocation, and `false` afterwards.
*
* @example
* ```typescript
* import { Utility } from '@aws-lambda-powertools/commons';
*
* const utility = new Utility();
*
* export const handler = async (_event: any, _context: any) => {
* utility.getColdStart();
* };
* ```
*
* #### `isColdStart()`
*
* This method is an alias of `getColdStart()` and is exposed for convenience and better readability in certain usages.
*
* @example
* ```typescript
* import { Utility } from '@aws-lambda-powertools/commons';
*
* const utility = new Utility();
*
* export const handler = async (_event: any, _context: any) => {
* if (utility.isColdStart()) {
* // do something, this block is only executed on the first invocation of the function
* } else {
* // do something else, this block gets executed on all subsequent invocations
* }
* };
* ```
*/
class Utility {

@@ -22,2 +79,8 @@ constructor() {

}
/**
* Validate that the service name provided is valid.
* Used internally during initialization.
*
* @param serviceName - Service name to validate
*/
isValidServiceName(serviceName) {

@@ -24,0 +87,0 @@ return typeof serviceName === 'string' && serviceName.trim().length > 0;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PT_VERSION = void 0;
// this file is auto generated, do not modify
exports.PT_VERSION = '1.13.1';

2

package.json
{
"name": "@aws-lambda-powertools/commons",
"version": "1.14.0",
"version": "1.14.1",
"description": "A shared utility package for Powertools for AWS Lambda (TypeScript) libraries",

@@ -5,0 +5,0 @@ "author": {

# Powertools for AWS Lambda (TypeScript) <!-- omit in toc -->
Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda-typescript/latest/#features).
Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda/typescript/latest/#features).
You can use the library in both TypeScript and JavaScript code bases.
> Also available in [Python](https://github.com/aws-powertools/powertools-lambda-python), [Java](https://github.com/aws-powertools/powertools-lambda-java), and [.NET](https://docs.powertools.aws.dev/lambda-dotnet/).
> Also available in [Python](https://github.com/aws-powertools/powertools-lambda-python), [Java](https://github.com/aws-powertools/powertools-lambda-java), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet).
**[Documentation](https://docs.powertools.aws.dev/lambda-typescript/)** | **[npm](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://docs.powertools.aws.dev/lambda-typescript/latest/roadmap)** | **[Examples](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples)**
**[Documentation](https://docs.powertools.aws.dev/lambda/typescript/)** | **[npm](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://docs.powertools.aws.dev/lambda/typescript/latest/roadmap)** | **[Examples](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples)**

@@ -31,12 +31,12 @@ ## Table of contents <!--- omit in toc -->

* **[Tracer](https://docs.powertools.aws.dev/lambda-typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions
* **[Logger](https://docs.powertools.aws.dev/lambda-typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context
* **[Metrics](https://docs.powertools.aws.dev/lambda-typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)
* **[Parameters](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/parameters/)** - High-level functions to retrieve one or more parameters from AWS SSM, Secrets Manager, AppConfig, and DynamoDB
* **[Idempotency](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/idempotency/)** - Class method decorator, Middy middleware, and function wrapper to make your Lambda functions idempotent and prevent duplicate execution based on payload content
* **[Batch processing](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/batch/)** - Utility to handle partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams.
* **[Tracer](https://docs.powertools.aws.dev/lambda/typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions
* **[Logger](https://docs.powertools.aws.dev/lambda/typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context
* **[Metrics](https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)
* **[Parameters](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/parameters/)** - High-level functions to retrieve one or more parameters from AWS SSM, Secrets Manager, AppConfig, and DynamoDB
* **[Idempotency](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/idempotency/)** - Class method decorator, Middy middleware, and function wrapper to make your Lambda functions idempotent and prevent duplicate execution based on payload content
* **[Batch processing](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/batch/)** - Utility to handle partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams.
## Getting started
Find the complete project's [documentation here](https://docs.powertools.aws.dev/lambda-typescript).
Find the complete project's [documentation here](https://docs.powertools.aws.dev/lambda/typescript).

@@ -57,9 +57,9 @@ ### Installation

๐Ÿ‘‰ [Installation guide for the **Tracer** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/core/tracer#getting-started)
๐Ÿ‘‰ [Installation guide for the **Tracer** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/core/tracer#getting-started)
๐Ÿ‘‰ [Installation guide for the **Logger** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/core/logger#getting-started)
๐Ÿ‘‰ [Installation guide for the **Logger** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/core/logger#getting-started)
๐Ÿ‘‰ [Installation guide for the **Metrics** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/core/metrics#getting-started)
๐Ÿ‘‰ [Installation guide for the **Metrics** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics#getting-started)
๐Ÿ‘‰ [Installation guide for the **Parameters** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/parameters/#getting-started)
๐Ÿ‘‰ [Installation guide for the **Parameters** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/parameters/#getting-started)

@@ -110,3 +110,3 @@ ### Examples

Share what you did with Powertools for AWS Lambda (TypeScript) ๐Ÿ’ž๐Ÿ’ž. Blog post, workshops, presentation, sample apps and others. Check out what the community has already shared about Powertools for AWS Lambda (TypeScript) [here](https://docs.powertools.aws.dev/lambda-typescript/latest/we_made_this).
Share what you did with Powertools for AWS Lambda (TypeScript) ๐Ÿ’ž๐Ÿ’ž. Blog post, workshops, presentation, sample apps and others. Check out what the community has already shared about Powertools for AWS Lambda (TypeScript) [here](https://docs.powertools.aws.dev/lambda/typescript/latest/we_made_this).

@@ -113,0 +113,0 @@ ### Using Lambda Layer

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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