Skip to content

About

Helper functions for AWS Lambda functions used in nRF Cloud.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

154 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@nrfcloud/lambda-helpers

https://github.com/nRFCloud/lambda-helpers/pkgs/npm/lambda-helpers

Helper functions for AWS Lambda functions used in nRF Cloud.

Installation

The package is published to the GitHub Packages registry. Releases are also published to npm.

To install it, point the @nrfcloud scope to it in your project's .npmrc and authenticate with a token that has the read:packages scope:

@nrfcloud:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
npm i (--save-prod|--save-dev) @nrfcloud/lambda-helpers

Usage

import { MetricUnit } from "@aws-lambda-powertools/metrics";
import { logMetrics } from "@aws-lambda-powertools/metrics/middleware";
import middy from "@middy/core";
import { metricsForComponent } from "@nrfcloud/lambda-helpers";

const { track, metrics } = metricsForComponent("my-function", "my-service");

export const handler = middy()
  .use(logMetrics(metrics))
  .handler(async () => {
    track("some:metric", MetricUnit.Count, 1);
  });

TypeScript 6 and 7

This repo runs TypeScript 6 and 7 side by side, so that eslint works.

About

Helper functions for AWS Lambda functions used in nRF Cloud.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages