open-index/open-npm huggingface dataset:
npm package: @michaeldera/simple-regex
Description: A simple library with common Zimbabwean regex patterns
Author: Michael Dera
Latest version: 1.1.2

# Simple Regex
[![npm version](https://badge.fury.io/js/simple-regex.svg)](https://badge.fury.io/js/simple-regex)
A simple package with common regex pattens for Zimbabwe

## Links
[Simple Regex Documentation](https://simple-regex.netlify.com/)

[Github Repository](https://github.com/michaeldera/simple-regex)

[NPM Package](https://www.npmjs.com/package/simple-regex)

## Installation 
For npm users `npm i simple-regex`
For yarn users `yarn add simple-regex`

## Usage
To test a variable against a Regex expression: 

`SimpleRegex.MobileNumber.Econet.test(<your-variable>)`. This will return a `boolean` which indicates whether your variable matches the Regex Pattern.

You can also inject the Regex Pattern into HTML form fields. An example of this pattern in ReactJS 
`<input type="text" name="number_plate" pattern={SimpleRegex.NumberPlate} title="Zimbabwean Number Plate">`


### Available Patterns

`SimpleRegex.MobileNumber.Econet` Pattern for Econet Mobile Numbers

`SimpleRegex.MobileNumber.Telecel` Pattern for Telecel Mobile Numbers

`SimpleRegex.MobileNumber.Netone` Pattern for Netone Mobile Numbers

`SimpleRegex.NumberPlate` Pattern for Zimbabwean National Vehicle Registration Numbers

`SimpleRegex.PassportNumber` Pattern for Zimbabwean Passport Numbers

`SimpleRegex.NationalId` Pattern for Zimbabwean National Identification Numbers 

`SimpleRegex.EmailAddress` Pattern for Email Addresses

`SimpleRegex.DriversLicence` Pattern for Zimbabwean Driver's Licences
npm package: @michaeldowseza/hello-world
Description: Hello world
Author: Michael Dowse
Latest version: 1.0.4

# Hello World

<!-- [START badges] -->

[![NPM version](https://img.shields.io/npm/v/@michaeldowseza/hello-world.svg)](https://www.npmjs.com/package/@michaeldowseza/hello-world)
[![NPM downloads](https://img.shields.io/npm/dm/@michaeldowseza/hello-world.svg)](https://www.npmjs.com/package/@michaeldowseza/hello-world)

![build](https://github.com/michaeldowseza/hello-world/actions/workflows/build.yml/badge.svg)
[![codecov](https://codecov.io/gh/michaeldowseza/hello-world/branch/main/graph/badge.svg?token=OLW8I1LX1M)](https://codecov.io/gh/michaeldowseza/hello-world) 

<!-- [END badges] -->

Simple Hello world project to play around with Github and Github actions

## Getting Started

## How To Install

```sh
npm install @michaeldowseza/hello-world
```

## How To Use

### ES6
```js
import helloWorld from '@michaeldowseza/hello-world';

helloWorld(); // -> "Hello world"
```

### ESM
```js
const helloWorld = require('@michaeldowseza/hello-world').default;

helloWorld(); // -> "Hello world"
```

## Contributing
Not really sure why you would want to but sure, open a pull request 🍻
npm package: @michaeldoyle/components-test
Description: A way to test components
Latest version: 0.0.14

# Components Test

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

- [✨ &nbsp;Release Notes](/CHANGELOG.md)
  <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/components-test?file=playground%2Fapp.vue) -->
  <!-- - [📖 &nbsp;Documentation](https://example.com) -->

## Features

<!-- Highlight some of the features your module provide here -->

- ⛰ &nbsp;Foo
- 🚠 &nbsp;Bar
- 🌲 &nbsp;Baz

## Quick Setup

1. Add `components-test` dependency to your project

```bash
# Using pnpm
pnpm add -D components-test

# Using yarn
yarn add --dev components-test

# Using npm
npm install --save-dev components-test
```

2. Add `components-test` to the `modules` section of `nuxt.config.ts`

```js
export default defineNuxtConfig({
  modules: ["components-test"],
});
```

That's it! You can now use Components Test in your Nuxt app ✨

## Development

```bash
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release
```

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/components-test/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/components-test
[npm-downloads-src]: https://img.shields.io/npm/dm/components-test.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/components-test
[license-src]: https://img.shields.io/npm/l/components-test.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/components-test
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com
npm package: @michaelfecher/lambda-powertools-cloudwatchevents-client
Description: CloudWatchEvents client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-cloudwatchevents-client

CloudWatchEvents client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the CloudWatchEvents events when you call `putEvents`

* direct replacement for `AWS.CloudWatchEvents` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-cloudwatchevents-client`

## API

It's exactly the same as the CloudWatchEvents client from the AWS SDK.

```js
const CloudWatchEvents = require('@michaelfecher/lambda-powertools-cloudwatchevents-client')

const publishEvents = async () => {
  const putEventsReq = {
    Entries: [
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello cloudwatchevents' })
      },
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await CloudWatchEvents.putEvents(putEventsReq).promise()
}
```
npm package: @michaelfecher/lambda-powertools-dynamodb-client
Description: Lambda client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-dynamodb-client

DynamoDB client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the DynamoDB item(s) so they are available in the DynamoDB Stream

* direct replacement for `AWS.DynamoDB.Document` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-dynamodb-client`

## API

It's exactly the same as the DynamoDB Document client from the AWS SDK.

```js
const DynamoDB = require('@michaelfecher/lambda-powertools-dynamodb-client')

await DynamoDB.put({
  TableName: 'table-name',
  Item: {
    Id: 'theburningmonk'
  }
}).promise()

await DynamoDB.update({
  TableName: 'table-name',
  Key: { Id: 'theburningmonk' },
  UpdateExpression: 'SET #url = :url',
  ExpressionAttributeNames: {
    '#url': 'url'
  },
  ExpressionAttributeValues: {
    ':url': 'https://theburningmonk.com'
  }
}).promise()

await DynamoDB.batchWrite({
  RequestItems: {
    ['table-name']: [
      {
        DeleteRequest: {
          Key: { Id: 'theburningmonk' }
        }
      },
      {
        PutRequest: {
          Item: {
            Id: 'theburningmonk'
          }
        }
      }
    ]
  }
}).promise()

await DynamoDB.transactWrite({
  TransactItems: [
    {
      Put: {
        TableName: 'table-name',
        Item: {
          Id: 'theburningmonk'
        }
      }
    },
    {
      Update: {
        TableName: tableName,
        Key: { Id: 'theburningmonk' },
        UpdateExpression: 'SET #url = :url',
        ExpressionAttributeNames: {
          '#url': 'url'
        },
        ExpressionAttributeValues: {
          ':url': 'https://theburningmonk.com'
        }
      }
    }
  ]
}).promise()
```
npm package: @michaelfecher/lambda-powertools-eventbridge-client
Description: EventBridge client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-eventbridge-client

EventBridge client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the EventBridge events when you call `putEvents`

* direct replacement for `AWS.EventBridge` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-eventbridge-client`

## API

It's exactly the same as the EventBridge client from the AWS SDK.

```js
const EventBridge = require('@michaelfecher/lambda-powertools-eventbridge-client')

const publishEvents = async () => {
  const putEventsReq = {
    Entries: [
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello eventbridge' })
      },
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await EventBridge.putEvents(putEventsReq).promise()
}
```
npm package: @michaelfecher/lambda-powertools-firehose-client
Description: Firehose client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# `lambda-powertools-firehose-client`

Firehose client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into Firehose records when you call `putRecord` or `putRecordBatch` (only JSON payloads are supported currently)

* direct replacement for `AWS.Firehose` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-firehose-client`

## API

It's exactly the same as the Kinesis client from the AWS SDK.

```js
const Firehose = require('@michaelfecher/lambda-powertools-firehose-client')

const publishEvent = async () => {
  const putRecordReq = {
    DeliveryStreamName: 'lambda-powertools-demo',
    PartitionKey: uuid(),
    Data: JSON.stringify({ message: 'hello firehose' })
  }

  await Firehose.putRecord(putRecordReq).promise()
}

const publishEvents = async () => {
  const putRecordBatchReq = {
    DeliveryStreamName: 'lambda-powertools-demo',
    Records: [
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello kinesis' })
      },
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await Firehose.putRecordBatch(putRecordBatchReq).promise()
}
```
npm package: @michaelfecher/lambda-powertools-http-client
Description: HTTP client that supports forwarding correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids) and auto-records metrics
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-http-client

HTTP client that automatically forwards correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`), and follows DAZN's convention around recording metrics around integration points.

Main features:

* auto-forwards any correlation IDs captured with the `@michaelfecher/lambda-powertools-correlation-ids` package as HTTP headers

* auto-record custom metrics using the `@michaelfecher/datadog-metrics` package, which defaults to async mode (i.e. writing to `stdout` in DogStatsD format) but can be configured via the `DATADOG_METRICS_MODE` environment variable

* custom metrics include:

  * `{hostName}.response.latency` [`histogram`]: e.g. `google.com.response.latency`

  * `{hostName}.response.{statusCode}` [`count`]: e.g. `google.com.response.200`

  metric names can be overriden with the `metricName` option (see below for details)

* all custom metrics include the tags `awsRegion`, `functionName`, `functionVersion`, `method` (e.g. `POST`) and `path` (e.g. `/v1/signin`)

* you can add additional tags by passing them in via the `metricTags` option (see below for details)

* supports timeout

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-http-client`

## API

Basic usage looks like this:

```js
const HTTP = require('@michaelfecher/lambda-powertools-http-client')

const sayIt = async () => {
  const httpRequest = {
    uri: `https://example.com/dev/say`,
    method: 'post',
    body: { message: 'hello world' }
  }

  await HTTP(httpRequest)
}
```

It's essentially a function that accepts a request of type:

```js
{
  uri/url : string (either uri or url must be specified)
  method  : GET (default) | POST | PUT | HEAD | DELETE | PATCH
  headers : object
  qs      : object
  body    : object
  metricName [optional] : string     // override the default metric name, e.g. 'adyenApi', which changes metrics to 'adyenapi.latency' and 'adyenapi.202'
  metricTags [optional] : string []  // additional tags for metrics, e.g. ['request_type:submit', 'load_test']
  timeout [optional] : int (millis)
}
```
npm package: @michaelfecher/lambda-powertools-kinesis-client
Description: Kinesis client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-kinesis-client

Kinesis client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into Kinesis records when you call `putRecord` or `putRecords` (only JSON payloads are supported currently)

* direct replacement for `AWS.Kinesis` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-kinesis-client`

## API

It's exactly the same as the Kinesis client from the AWS SDK.

```js
const Kinesis = require('@michaelfecher/lambda-powertools-kinesis-client')

const publishEvent = async () => {
  const putRecordReq = {
    StreamName: 'lambda-powertools-demo',
    PartitionKey: uuid(),
    Data: JSON.stringify({ message: 'hello kinesis' })
  }

  await Kinesis.putRecord(putRecordReq).promise()
}

const publishEvents = async () => {
  const putRecordsReq = {
    StreamName: 'lambda-powertools-demo',
    Records: [
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello kinesis' })
      },
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await Kinesis.putRecords(putRecordsReq).promise()
}
```
npm package: @michaelfecher/lambda-powertools-lambda-client
Description: Lambda client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-lambda-client

Lambda client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the invocation payload when you call `invoke` or `invokeAsync`

* direct replacement for `AWS.Lambda` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-lambda-client`

## API

It's exactly the same as the Lambda client from the AWS SDK.

```js
const Lambda = require('@michaelfecher/lambda-powertools-lambda-client')

const invoke = async () => {
  const invokeReq = {
    FunctionName: 'my-function',
    InvocationType: 'Event',
    Payload: JSON.stringify({ message: 'hello lambda' })
  }

  await Lambda.invoke(invokeReq).promise()

  const invokeAsyncReq = {
    FunctionName: 'my-function',
    InvokeArgs: JSON.stringify({ message: 'hello lambda' })
  }

  await Lambda.invokeAsync(invokeAsyncReq).promise()
}
```
npm package: @michaelfecher/lambda-powertools-middleware-log-timeout
Description: Middy middleware to log an error message when a function times out.
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-middleware-log-timeout

A [Middy](https://github.com/middyjs/middy) middleware that will log a timeout error message **just before** the function actually times out.

Main features:

* records an error log message `invocation timed out` (with the invocation event as attribute) when an invocation times out

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-middleware-log-timeout`

Alternatively, if you use the template `@michaelfecher/lambda-powertools-pattern-basic` then this would be configured for you.

## API

The middleware accepts an optional constructor parameter `thresholdMillis`, which is the number of millis before an invocation is timed out, that an error message is logged. `thresholdMillis` defaults to **10ms**.

```js
const middy = require('middy')
const logTimeout = require('@michaelfecher/lambda-powertools-middleware-log-timeout')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  // or .use(logTimeout(50)) to log the timeout error message 50ms before invocation times out
  .use(logTimeout()) // defaults to 10ms
}
```

It's **recommended** that you use the `@michaelfecher/lambda-powertools-pattern-basic` which configures this middleware along with other useful middlewares.
npm package: @michaelfecher/lambda-powertools-middleware-obfuscater
Description: Middy middleware to obfuscate the event for logging
Author: Tom Rogers
Latest version: 1.28.1

# lambda-powertools-middleware-obfuscater

A [Middy](https://github.com/middyjs/middy) middleware that will enable debug logging for a configurable % of invocations. Defaults is 1%.

Main features:

* records an error log message with the invocation event as attribute when an invocation errors. These invocation errors may be obfuscated to avoid the leaking of Personal Identifiable Information.

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-middleware-obfuscater`

Alternatively, if you use the template `@michaelfecher/lambda-powertools-pattern-obfuscate` then this would be configured for you.

## API

Accepts a configuration object of the following shape:

```js
{
  obfuscationFilter: string array formatted like ["object.key.to.obfuscate"]
}
```

```js
  {
    Records: [
        { firstName: "personal" secondName: "identifiable" email: "inform@ti.on" },
        { firstName: "second" secondName: "personal" email: "inform@ti.on" }
      ]
  }

  // To filter the above object you would pass
  const obfuscationFilter = ["Records.*.firstName", "Records.*.secondName", "Records.*.email"]
```

The output would be...

```js
{
  Records: [
      { firstName: "********" secondName: "************" email: "******@**.**" },
      { firstName: "******" secondName: "********" email: "******@**.**" }
    ]
}
```

similarly, you can filter entire objects, for instance.
```js
  const obfuscationFilter = ["Records.*.personal"]
  {
    Records: [
      { personal: { firstName: "********" secondName: "************" email: "******@**.**" } }.
      { personal: { firstName: "******" secondName: "********" email: "******@**.**", address: { postcode: "******", street: "* ****** ***", country: "**" }}}
    ]
  }
```

This will recursively filter every object and subobjects

```js
const middy = require('middy')
const obfuscatedLogging = require('@michaelfecher/lambda-powertools-middleware-obfuscater')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  .use(obfuscatedLogging.obfuscaterMiddleware({ sampleRate: 0.01, obfuscationFilters: ["example.example"] }))
}
```

This middleware is often used alongside the `@michaelfecher/lambda-powertools-middleware-correlation-ids` middleware to implement sample logging. It's **recommended** that you use the `@michaelfecher/lambda-powertools-pattern-obfuscate` which configures both to enable debug logging at 1% of invocations.
npm package: @michaelfecher/lambda-powertools-middleware-sample-logging
Description: Middy middleware to sample debug logs for a configurable % of invocations
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-middleware-sample-logging

A [Middy](https://github.com/middyjs/middy) middleware that will enable debug logging for a configurable % of invocations. Defaults is 1%.

Main features:

* integrates with the `@michaelfecher/lambda-powertools-logger` package to enable debug logging

* integrates with the `@michaelfecher/lambda-powertools-correlation-ids` package to allow sampling decision to flow through correlation IDs - i.e. enable debug logging at the edge, and the entire call chain will respect that decision

* enables debug logging for some % (defaults to 1%) of invocations

* records an error log message with the invocation event as attribute when an invocation errors

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-middleware-sample-logging`

Alternatively, if you use the template `@michaelfecher/lambda-powertools-pattern-basic` then this would be configured for you.

## API

Accepts a configuration object of the following shape:

```js
{
  sampleRate: double [between 0 and 1]
}
```

```js
const middy = require('middy')
const sampleLogging = require('@michaelfecher/lambda-powertools-middleware-sample-logging')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  .use(sampleLogging({ sampleRate: 0.01 }))
}
```

This middleware is often used alongside the `@michaelfecher/lambda-powertools-middleware-correlation-ids` middleware to implement sample logging. It's **recommended** that you use the `@michaelfecher/lambda-powertools-pattern-basic` which configures both to enable debug logging at 1% of invocations.
npm package: @michaelfecher/lambda-powertools-middleware-stop-infinite-loop
Description: Middy middleware that detects and stops infinite loops
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-middleware-stop-infinite-loop

A [Middy](https://github.com/middyjs/middy) middleware that will stop an invocation if it's deemed to be part of an infinite loop.

Main features:

* errors if the `call-chain-length` reaches the configured threshold (defaults to `10`)

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-middleware-stop-infinite-loop`

## API

The middleware accepts an optional constructor parameter `threshold`, which is the max length allowed for the entire call chain.

This middleware is intended to be used alongside `@michaelfecher/lambda-powertools-middleware-correlation-ids`, which is responsible for collecting correlation IDs and incrementing the `call-chain-length` (i.e. the number of function invocations that are chained together) at the start of an invocation.

Because this middleware relies on `@michaelfecher/lambda-powertools-middleware-correlation-ids`, it needs to be applied **AFTER** `@michaelfecher/lambda-powertools-middleware-correlation-ids` (as seen below).

```js
const middy = require('middy')
const correlationIds = require('@michaelfecher/lambda-powertools-middleware-correlation-ids')
const stopInfiniteLoop = require('@michaelfecher/lambda-powertools-middleware-stop-infinite-loop')

const handler = async (event, context) => {
  return 42
}

module.exports = middy(handler)
  .use(correlationIds())
  .use(stopInfiniteLoop()) // defaults to 10
}
```
npm package: @michaelfecher/lambda-powertools-pattern-basic
Description: Basic template that configures a 1% smaple rate for debug logs
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-pattern-basic

A basic pattern that helps you follow our guidelines around logging and monitoring.

Main features:

* configures Datadog metrics namespace using the function name if one is not specified already

* configures Datadog default tags with `awsRegion`, `functionName`, `functionVersion` and `environment`

* applies the `@michaelfecher/lambda-powertools-middleware-correlation-ids` middleware at a default 1% sample rate

* applies the `@michaelfecher/lambda-powertools-middleware-sample-logging` middleware at a default 1% sample rate

* applies the `@michaelfecher/lambda-powertools-middleware-log-timeout` middleware at default 10ms threshold (i.e. log an error message 10ms before an invocation actually times out)

* allow override for the default 1% sample rate via a `SAMPLE_DEBUG_LOG_RATE` environment variable, to sample debug logs at 5% rate then set `SAMPLE_DEBUG_LOG_RATE` to `0.05`

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-pattern-basic`

## API

```js
const wrap = require('@michaelfecher/lambda-powertools-pattern-basic')

module.exports.handler = wrap(async (event, context) => {
  return 42
})
```
npm package: @michaelfecher/lambda-powertools-pattern-obfuscate
Description: Basic template that configures a 1% smaple rate for debug logs and obfuscation
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-pattern-obfuscate

A pattern that helps you follow our guidelines around logging and monitoring. With added ability to obfuscate personal fields.

Main features:

* configures Datadog metrics namespace using the function name if one is not specified already

* configures Datadog default tags with `awsRegion`, `functionName`, `functionVersion` and `environment`

* applies the `@michaelfecher/lambda-powertools-middleware-correlation-ids` middleware at a default 1% sample rate

* applies the `@michaelfecher/lambda-powertools-middleware-sample-logging` middleware at a default 1% sample rate

* applies the `@michaelfecher/lambda-powertools-middleware-obfuscated-logging` middleware with passed obfuscation filters

* applies the `@michaelfecher/lambda-powertools-middleware-log-timeout` middleware at default 10ms threshold (i.e. log an error message 10ms before an invocation actually times out)

* allow override for the default 1% sample rate via a `SAMPLE_DEBUG_LOG_RATE` environment variable, to sample debug logs at 5% rate then set `SAMPLE_DEBUG_LOG_RATE` to `0.05`

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-pattern-obfuscate`

## API

```js
const obfuscatedWrap = require('@michaelfecher/lambda-powertools-pattern-obfuscated')

module.exports.handler = obfuscatedWrap.obfuscaterPattern(['Records.*.firstName', 'Records.*.lastName'], async (event, context) => {
  return 42
})
```
npm package: @michaelfecher/lambda-powertools-sns-client
Description: SNS client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-sns-client

SNS client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* direct replacement for `AWS.SNS` client
* auto-injects correlation IDs into SNS message when you call `publish`
* allow correlation IDs to be overriden with `publishWithCorrelationIds` (useful when processing batch-based event sources such as SQS and Kinesis, where every record has its own set of correlation IDs)

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-sns-client`

## API

It's exactly the same as the SNS client from the AWS SDK.

```js
const SNS = require('@michaelfecher/lambda-powertools-sns-client')

const publishMessage = async () => {
  const req = {
    Message: JSON.stringify({ message: 'hello sns' }),
    TopicArn: 'my-sns-topic'
  }

  await SNS.publish(req).promise()
}
```
npm package: @michaelfecher/lambda-powertools-sqs-client
Description: SQS client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-sqs-client

SQS client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* direct replacement for `AWS.SQS` client
* auto-injects correlation IDs into SQS message when you call `sendMessage` or `sendMessageBatch`
* allow correlation IDs to be overriden with `sendMessageWithCorrelationIds` and `sendMessageBatchWithCorrelationIds` (useful when processing batch-based event sources such as SQS and Kinesis, where every record has its own set of correlation IDs)

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-sqs-client`

## API

It's exactly the same as the SQS client from the AWS SDK.

```js
const SQS = require('@michaelfecher/lambda-powertools-sqs-client')

const sendMessage = async () => {
  const req = {
    MessageBody: JSON.stringify({ message: 'hello sqs' }),
    QueueUrl: 'my-sqs-queue'
  }

  await SQS.sendMessage(req).promise()
}
```
npm package: @michaelfecher/lambda-powertools-step-functions-client
Description: SFN client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/lambda-powertools-correlation-ids)
Author: Yan Cui
Latest version: 1.28.1

# lambda-powertools-step-functions-client

Step Functions (SFN) client wrapper that knows how to forward correlation IDs (captured via `@michaelfecher/lambda-powertools-correlation-ids`).

Main features:

* auto-injects correlation IDs into the invocation payload when you call `startExecution`

* direct replacement for `AWS.StepFunctions` client

## Getting Started

Install from NPM: `npm install @michaelfecher/lambda-powertools-step-functions-client`

## API

It's exactly the same as the Step Functions (SFN) client from the AWS SDK.

```js
const SFN = require('@michaelfecher/lambda-powertools-step-functions-client')

const publishMessage = async () => {
  const req = {
    stateMachineArn: 'my-state-machine',
    input: JSON.stringify({ message: 'hello sfn' }),
    name: 'test'
  }

  await SFN.startExecution(req).promise()
}
```