open-index/open-npm huggingface dataset:
npm package: @lambda-capacitor/cli
Description: Capacitor: Cross-platform apps with JavaScript and the web
Author: Ionic Team
Latest version: 1.0.14

# Capacitor CLI

The Capacitor command-line interface should be installed locally and executed through `npm` scripts.

```
npm install @lambda-capacitor/cli --save-dev
```

## Using Capacitor CLI

Consult the Getting Started guide for information on using the CLI and Capacitor scripts.

### License

- [MIT](https://github.com/ionic-team/capacitor/blob/master/LICENSE)
npm package: @lambda-fn/basis
Description: Basis for lambda-fn
Author: Dmitry Belyaev
Latest version: 1.0.0

# @lambda-fn/basis

Basis for lambda-fn

## Install

```bash
npm install --save @lambda-fn/basis
# or
yarn add @lambda-fn/basis
```

## Documentation

[See on github](https://github.com/bingo347/lambda-fn/blob/main/docs/basis/README.md)

## License

MIT
npm package: @lambda-fn/cell
Description: Simple container for store mutable value
Author: Dmitriy Belyaev
Latest version: 1.1.2

# @lambda-fn/cell

Simple container for store mutable value
[inspired by std::cell::Cell from Rust](https://doc.rust-lang.org/std/cell/struct.Cell.html)

## Install

```bash
npm install --save @lambda-fn/cell
# or
yarn add @lambda-fn/cell
```

## Exports

```typescript
interface CellStatic {
    isCell(maybeCell: unknown): maybeCell is Cell<unknown>;
    isCellWith<T>(guard: (v: unknown) => v is T, maybeCell: unknown): maybeCell is Cell<T>;
}
interface CellFactory extends CellStatic {
    <T>(initialValue: T): Cell<T>;
}
interface Cell<T> {
    value: T;
    get(): T;
    set(value: T): void;
    update(updater: (value: T) => T): void;
    subscribe(subscription: (value: T) => void): () => void;
    clone(): Cell<T>;
    map<U>(mapper: (value: T) => U): Cell<U>;
    fold<U>(mapper: (value: T) => U): U;
}

// Cell also is default export
function Cell<T>(initialValue: T): Cell<T>; // implements CellFactory

function isCell(maybeCell: unknown): maybeCell is Cell<unknown>;
function isCellWith<T>(guard: (v: unknown) => v is T, maybeCell: unknown): maybeCell is Cell<T>;

function get<T>(cell: Cell<T>): T;
function set<T>(cell: Cell<T>, value: T): void;
function update<T>(cell: Cell<T>, updater: (value: T) => T): void;
function subscribe<T>(cell: Cell<T>, subscription: (value: T) => void): () => void;
function clone<T>(cell: Cell<T>): Cell<T>;
function map<T, U>(cell: Cell<T>, mapper: (value: T) => U): Cell<U>;
function map<T, U>(mapper: (value: T) => U): (cell: Cell<T>) => Cell<U>;
function fold<T, U>(cell: Cell<T>, mapper: (value: T) => U): U;
function fold<T, U>(mapper: (value: T) => U): (cell: Cell<T>) => U;
```

## Example

```typescript
import Cell from '@lambda-fn/cell';

const counter = Cell(0);
const unsubscribe = counter.subscribe(v => {
    console.log(`Result: ${v}`);
});
const interval = setInterval(() => {
    counter.value++;
}, 100);
setTimeout(() => {
    unsubscribe();
    clearInterval(interval);
    console.log(counter.fold(v => `Result: ${v}`));
}, 3000);

```

Or in FP style:

```typescript
import {Cell, update, fold} from '@lambda-fn/cell';

const counter = Cell(0);
const foldToString = fold((v: number) => `Result: ${v}`);
const unsubscribe = subscribe(counter, () => {
    console.log(foldToString(counter));
});
const interval = setInterval(() => {
    update(counter, v => v + 1);
}, 100);
setTimeout(() => {
    unsubscribe();
    clearInterval(interval);
    console.log(foldToString(counter));
}, 3000);
```

Cell also implements [writable store](https://svelte.dev/docs#writable) from [Svelte](https://www.npmjs.com/package/svelte):

```svelte
<script>
import Cell from '@lambda-fn/cell';

const counter = Cell(0);
</script>

<button on:click={() => $counter++}>Clicked {$counter} times</button>
```

## License

MIT
npm package: @lambda-fn/type-guards
Description: Type guards for basic javascript types
Author: Dmitry Belyaev
Latest version: 1.4.0

# @lambda-fn/type-guards

Type guards for basic javascript types

## Install

```bash
npm install --save @lambda-fn/type-guards
# or
yarn add @lambda-fn/type-guards
```

## Documentation

[See on github](https://github.com/bingo347/lambda-fn/blob/main/docs/type-guards/README.md)

## License

MIT
npm package: @lambda-group/axum-js
Description: A Axum http wrapper for NodeJS
Author: Daniel Boll
Latest version: 0.2.0

<div align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://socialify.git.ci/daniel-boll/axum-js/image?description=1&descriptionEditable=%F0%9F%9A%80%20A%20Axum%20http%20wrapper%20for%20NodeJS%20built%20in%20Rust%20%F0%9F%A6%80&font=Inter&issues=1&language=1&name=1&owner=1&pattern=Solid&stargazers=1&theme=Dark">
    <img src="https://socialify.git.ci/daniel-boll/axum-js/image?description=1&descriptionEditable=%F0%9F%9A%80%20A%20Axum%20http%20wrapper%20for%20NodeJS%20built%20in%20Rust%20%F0%9F%A6%80&font=Inter&issues=1&language=1&name=1&owner=1&pattern=Solid&stargazers=1&theme=Dark" alt="axum-js" />
  </picture>
  <br/>
  <br/>
  
![Tests Status][badge-tests]
![Deploy Status][badge-deploy]

</div>

[badge-tests]:https://img.shields.io/github/actions/workflow/status/daniel-boll/axum-js/test.yml?branch=main&label=tests&logo=github&style=for-the-badge
[badge-deploy]:https://img.shields.io/github/actions/workflow/status/daniel-boll/axum-js/publish.yml?branch=main&label=deploy&logo=github&style=for-the-badge


<div align="center">

[![NPM version](https://img.shields.io/npm/v/@lambda-group/axum-js.svg?style=flat-square)](https://www.npmjs.com/package/@lambda-group/axum-js)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](CONTRIBUTING.md)
[![Twitter Follow](https://img.shields.io/twitter/follow/db_regret?style=social)](https://x.com/db_regret)

</div>

`axum-js` is a TypeScript/JavaScript wrapper around the Rust [Axum](https://github.com/tokio-rs/axum) crate, brought to you via [Napi-rs](https://github.com/napi-rs/napi-rs). This initiative seeks to imbue the JavaScript ecosystem with the resiliency and efficiency inherent to Axum.

Initiated during Hacktoberfest 2023 by Daniel Boll, this project now thrives under the stewardship of the `@lambda-group`.

## 🎯 Supported Platforms

- `darwin-x64`
- `linux-x64-gnu`
- `win32-x64-msvc`

## 🚀 Installation

```bash
npm install @lambda-group/axum-js
```

## 🛠 Usage

```javascript
import { axum } from "@lambda-group/axum-js";

const app = axum();
const port = 3000;

app.get('/', (req, res) => {
  res.send('Hello World!')
});

app.listen(port, () => {
  console.log(`Server is humming on port ${port}`)
});
```

## 🤝 Contributing

We're always on the lookout for contributions. Navigate to [CONTRIBUTING.md](CONTRIBUTING.md) for the scoop on how you can join the crew.

## 📜 License

Distributed under the [MIT License](LICENSE).

## 🙏 Acknowledgements

- Kudos to the Axum and Napi-rs communities for laying the groundwork that made `axum-js` feasible.
- A world of thanks to every contributor to `axum-js`, your input, no matter the magnitude, propels us forward.

---

<div align="center">
   Idealized with ❤️ by Daniel Boll
</div>
npm package: @lambda-group/charydbis
Description: 🚀 NodeJS ScyllaDB ORM. 🧪🔧
Author: Daniel Boll
Latest version: 0.4.1

<div align="center">
  <a href="https://github.com/daniel-boll/charydbis">
    <img src="assets/logo.png" alt="scylladb" width="340" />
  </a>

  <h4>🚀 JavaScript ORM for ScyllaDB. Pre-release stage. 🧪🔧</h4>
</div>

## 📥 Installing 📥

To install this package, use the following command:

```bash
npm i @lambda-group/charydbis @lambda-group/scylladb
```

## 🚀 Getting Started 🚀

These instructions will get you a copy of the project up and running 🏃 on your local machine for development and testing purposes.

### 📋 Prerequisites 📋

- Docker: We use Docker 🐳 to run the Scylla database easily without the need for a complex local setup.
- Node.js: Make sure you have Node.js installed on your system to run JavaScript code.
- Scylla Driver: To handle the connections.

### 🌟 Quickstart 🌟

1. **Start ScyllaDB in Docker:**

   Run a ScyllaDB instance using the following Docker command:

   ```bash
   docker run --name scylladb -d --rm -it -p 9042:9042 scylladb/scylla --smp 2
   ```

   This command pulls the Scylla image if it's not already present on your system, and starts a new 🌟 container with the Scylla database.

2. **Create a DataSource:**

   Here's a simple script that creates a data source:

   ```typescript
   import { DataSource } from "@lambda-group/charydbis";

   using scyllaDataSource = await new DataSource({
     nodes: ["localhost:9042"],
   }).initialize("system_schema");
   ```

   Here we leverage the `using` keyword so in the end of the scope on [Symbol.dispose] we automatically close the connection so you don't have to bother.

3. **Create a model:**

   Now we can create a structure that will represent out data.

   ```typescript
   @Model("scylla_tables")
   class ScyllaTables {
     @Column()
     name: string;
   }
   ```

4. **Access the repository:**

   You can now get a default repository from the model.

   ```ts
   const scyllaTablesRepository = scyllaDataSource.getRepository(ScyllaTables);

   const tables: Array<ScyllaTables> = await scyllaTablesRepository.find();
   ```

---

You can find more [examples](https://github.com/daniel-boll/charydbis/tree/main/examples) in the examples folder.
npm package: @lambda-group/scylladb
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

<div align="center">

[![ScyllaDB Unnoficial Discord Server](https://img.shields.io/badge/ScyllaDB_Developers-Discord_Server-4C388C)](https://discord.gg/CzCT4cyRrr)

</div>

<div align="center">
  <a href="https://github.com/daniel-boll/scylla-javascript-driver">
    <img src="assets/logo.png" alt="Scylla Nodejs Driver" width="640" />
  </a>

  <h4>🚀 ScyllaDB NodeJS Driver 🧪🔧</h4>
</div>

## ⚠️ Disclaimer ⚠️

This repository and the associated npm package are currently in a 🐣 pre-release state and are being used for testing 🧪 purposes. They are subject to change without notice 📝. Users are encouraged to use this driver with caution ❗ and not in production environments until the official release.

## 🚀 Getting Started 🚀

These instructions will get you a copy of the project up and running 🏃 on your local machine for development and testing purposes.

### 📋 Prerequisites 📋

- Docker: We use Docker 🐳 to run the Scylla database easily without the need for a complex local setup.
- Node.js: Make sure you have Node.js installed on your system to run JavaScript code.

### 🌟 Quickstart 🌟

1. **Start ScyllaDB in Docker:**

   Run a ScyllaDB instance using the following Docker command:

   ```bash
   docker run --name scylladb -d --rm -it -p 9042:9042 scylladb/scylla --smp 2
   ```

   This command pulls the Scylla image if it's not already present on your system, and starts a new 🌟 container with the Scylla database.

2. **Use the JavaScript Driver:**

   Here's a simple script to connect to the database and execute a query:

   ```javascript
   import { Cluster } from "@lambda-group/scylladb";

   const cluster = new Cluster({
     nodes: ["127.0.0.1:9042"],
   });

   const session = await cluster.connect("system_schema");

   const result = await session.execute("SELECT * FROM scylla_tables limit ?", [1]).catch(console.error);

   console.log(result);
   ```

   This script connects to the ScyllaDB instance running on your machine, performs a query, and logs the result.

### 📥 Installing 📥

To install this package, use the following command:

```bash
npm install @lambda-group/scylladb@latest
```

## 📚 Examples 📚

Reference wise you can guide yourself through the [examples/](https://github.com/Daniel-Boll/scylla-javascript-driver/tree/main/examples) folder in the repo.

## 🙏 Acknowledgments 🙏

- Thanks to the developers of ScyllaDB for creating such a high-performance database.
- Thanks to the Rust community for providing the robust `scylla` crate.
- Thanks to the `napi-rs` project for enabling efficient Rust and Node.js integrations.
npm package: @lambda-group/scylladb-android-arm-eabi
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-android-arm-eabi`

This is the **armv7-linux-androideabi** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-android-arm64
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-android-arm64`

This is the **aarch64-linux-android** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-darwin-arm64
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-darwin-arm64`

This is the **aarch64-apple-darwin** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-darwin-universal
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Latest version: 0.5.1

# `@lambda-group/scylladb-darwin-universal`

This is the **universal-apple-darwin** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-darwin-x64
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-darwin-x64`

This is the **x86_64-apple-darwin** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-linux-arm-gnueabihf
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-linux-arm-gnueabihf`

This is the **armv7-unknown-linux-gnueabihf** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-linux-arm64-gnu
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-linux-arm64-gnu`

This is the **aarch64-unknown-linux-gnu** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-linux-arm64-musl
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-linux-arm64-musl`

This is the **aarch64-unknown-linux-musl** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-linux-x64-gnu
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-linux-x64-musl
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Author: Daniel Boll
Latest version: 0.7.1

# `@lambda-group/scylladb-linux-x64-musl`

This is the **x86_64-unknown-linux-musl** binary for `@lambda-group/scylladb`
npm package: @lambda-group/scylladb-win32-x64-msvc
Description: 🚀 JavaScript driver for ScyllaDB, harnessing Rust's power through napi-rs for top performance. Pre-release stage. 🧪🔧
Latest version: 0.0.7

# `@lambda-group/scylladb-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@lambda-group/scylladb`
npm package: @lambda-lambda-lambda/types
Description: L³ application TypeScript type definitions.
Author: Marc S. Brooks
Latest version: 0.0.3

# L³ types

[![npm version](https://badge.fury.io/js/@lambda-lambda-lambda%2Ftypes.svg)](https://badge.fury.io/js/@lambda-lambda-lambda%2Ftypes) [![Build Status](https://img.shields.io/github/actions/workflow/status/lambda-lambda-lambda/types/.github%2Fworkflows%2Fci.yml)](https://github.com/lambda-lambda-lambda/types/actions)

[L³](https://github.com/lambda-lambda-lambda) application [TypeScript](https://www.typescriptlang.org) type definitions.

## Dependencies

- [Node.js](https://nodejs.org)

## Installation

Install the command-line utility using [NPM](https://npmjs.com).

    $ npm install -g @lambda-lambda-lambda/types

## Usage

```javascript

import {AppConfig} from '@lambda-lambda-lambda/types/cli';
```

## Developers

### CLI options

Run [ESLint](https://eslint.org/) types testing:

    $ npm run test

## Contributions

If you fix a bug, or have a code you want to contribute, please send a pull-request with your changes. (Note: Before committing your code please ensure that you are following the [TypeScript style guide](https://github.com/basarat/typescript-book/blob/master/docs/styleguide/styleguide.md))

## Versioning

This package is maintained under the [Semantic Versioning](https://semver.org) guidelines.

## License and Warranty

This package is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

_lambda-lambda-lambda/types_ is provided under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.php)

## Author

[Marc S. Brooks](https://github.com/nuxy)
npm package: @lambda-middleware/do-not-wait
Description: AWS lambda middleware to prevent Lambda from timing out because of processes running after returning a value.
Author: Daniel Bartholomae
Latest version: 1.0.1

# @lambda-middleware/do-not-wait

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fdo-not-wait.svg)](https://npmjs.org/package/@lambda-middleware/do-not-wait)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fdo-not-wait.svg)](https://npmjs.org/package/@lambda-middleware/do-not-wait)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

AWS lambda middleware to prevent Lambda from timing out because of processes running after returning a value.

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { doNotWait } from "@lambda-middleware/do-not-wait";

// This is your AWS handler
async function helloWorld() {
  return {
    statusCode: 200,
    body: "",
  };
}

// Wrap the handler with the middleware
export const handler = doNotWait()(helloWorld);
```
npm package: @lambda-middleware/frameguard
Description: AWS lambda middleware for preventing clickjacking by using frameguards
Author: Daniel Bartholomae
Latest version: 1.1.0

# @lambda-middleware/frameguard

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fframeguard.svg)](https://npmjs.org/package/@lambda-middleware/frameguard)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fframeguard.svg)](https://npmjs.org/package/@lambda-middleware/frameguard)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

AWS lambda middleware for preventing clickjacking by using frameguards

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { frameguard } from "@lambda-middleware/frameguard";
import { APIGatewayProxyResult } from "aws-lambda";

// This is your AWS handler
async function helloWorld(): Promise<APIGatewayProxyResult> {
  return {
    statusCode: 200,
    body: "",
  };
}

// Wrap the handler with the middleware
export const handler = frameguard()(helloWorld);
```
npm package: @lambda-middleware/http-error-handler
Description: An error handler middleware for AWS http lambda functions.
Author: Daniel Bartholomae
Latest version: 2.0.0

# @lambda-middleware/http-error-handler

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fhttp-error-handler.svg)](https://npmjs.org/package/@lambda-middleware/http-error-handler)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fhttp-error-handler.svg)](https://npmjs.org/package/@lambda-middleware/http-error-handler)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

An error handler middleware for AWS http lambda functions, compatible with [http-errors](https://www.npmjs.com/package/http-errors).

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { errorHandler } from "@lambda-middleware/errorHandler";
import { APIGatewayEvent, APIGatewayProxyResult } from "aws-lambda";
import createHttpError from "http-errors";

// This is your AWS handler
async function helloWorld(
  event: APIGatewayEvent
): Promise<APIGatewayProxyResult> {
  if (event.queryStringParameters?.search == null) {
    // If you throw an error with status code, the error will be returned as stringified JSON
    // Only the stack will be omitted.
    throw createHttpError(400, "Query has to include a search");
  }

  // If you throw an error with no status code, only a generic message will be shown to the user
  // instead of the full error
  throw new Error("Search is not implemented yet");
}

// Wrap the handler with the middleware
export const handler = errorHandler()(helloWorld);
```
npm package: @lambda-middleware/http-header-normalizer
Description: Middleware for AWS lambdas that normalizes headers to lower-case
Author: Daniel Bartholomae
Latest version: 1.0.3

# @lambda-middleware/http-header-normalizer

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fhttp-header-normalizer.svg)](https://npmjs.org/package/@lambda-middleware/http-header-normalizer)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fhttp-header-normalizer.svg)](https://npmjs.org/package/@lambda-middleware/http-header-normalizer)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

Middleware for AWS lambdas that normalizes headers to lower-case and referer to referrer and vice-versa.
If you are used to [the corresponding middy middleware](https://www.npmjs.com/package/@middy/http-header-normalizer), please note that this middleware acts differently as it does not hold an exception list and converts everything to lower-case.

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { httpHeaderNormalizer } from "@lambda-middleware/http-header-normalizer";
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";

// This is your AWS handler
async function helloWorld({
  headers,
}: APIGatewayProxyEvent): APIGatewayProxyResult {
  return {
    body: JSON.stringify({
      msg: headers["custom-header"],
    }),
    statusCode: 200,
  };
}

// Wrap the handler with the middleware
export const handler = httpHeaderNormalizer()(helloWorld);
```
npm package: @lambda-middleware/ie-no-open
Description: A middleware for adding the download options no-open header to AWS lambdas.
Author: Daniel Bartholomae
Latest version: 1.0.2

# @lambda-middleware/ie-no-open

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fie-no-open.svg)](https://npmjs.org/package/@lambda-middleware/ie-no-open)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fie-no-open.svg)](https://npmjs.org/package/@lambda-middleware/ie-no-open)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

A middleware for adding the [download options no-open header](https://docs.microsoft.com/en-us/archive/blogs/ie/ie8-security-part-v-comprehensive-protection) for Internet Explorer to AWS lambdas.

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { ieNoOpen } from "@lambda-middleware/ie-no-open";

// This is your AWS handler
async function helloWorld() {
  return {
    statusCode: 200,
    body: "",
  };
}

// Wrap the handler with the middleware
export const handler = ieNoOpen()(helloWorld);
```
npm package: @lambda-middleware/json-serializer
Description: A middleware for AWS http lambda functions to serialize JSON responses.
Author: Daniel Bartholomae
Latest version: 2.1.1

# @lambda-middleware/json-serializer

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fjson-serializer.svg)](https://npmjs.org/package/@lambda-middleware/json-serializer)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fjson-serializer.svg)](https://npmjs.org/package/@lambda-middleware/json-serializer)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

A middleware for AWS http lambda functions to serialize JSON responses, including correct status codes and content-header.

Please note that this middleware just uses `JSON.stringify` for serialization and therefore does **not** strip any serializable content.
Please act as if any data your handler returns could end up on the client side and take care of appropriate whitelisting in the handler or a different middleware!

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { jsonSerializer } from "@lambda-middleware/json-serializer";

interface Response {
  // Undefined values will be stripped out
  name?: string;
}

// This is your AWS handler
async function helloWorld(): Promise<Response> {
  return {};
}

// Wrap the handler with the middleware
export const handler = jsonSerializer()(helloWorld);
```
npm package: @lambda-middleware/no-sniff
Description: A middleware for adding the content type options no-sniff header to AWS lambdas.
Author: Daniel Bartholomae
Latest version: 1.0.2

# @lambda-middleware/no-sniff

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Fno-sniff.svg)](https://npmjs.org/package/@lambda-middleware/no-sniff)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Fno-sniff.svg)](https://npmjs.org/package/@lambda-middleware/no-sniff)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

A middleware for adding the [content type options no-sniff header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) to AWS lambdas.

## Lambda middleware

This middleware is part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). It can be used independently.

## Usage

```typescript
import { noSniff } from "@lambda-middleware/no-sniff";

// This is your AWS handler
async function helloWorld() {
  return {
    statusCode: 200,
    body: "",
  };
}

// Wrap the handler with the middleware
export const handler = noSniff()(helloWorld);
```
npm package: @lambda-middleware/utils
Description: Utilities for use with AWS lambda middleware
Author: Daniel Bartholomae
Latest version: 1.1.0

# @lambda-middleware/utils

[![npm version](https://badge.fury.io/js/%40lambda-middleware%2Futils.svg)](https://npmjs.org/package/@lambda-middleware/utils)
[![downloads](https://img.shields.io/npm/dw/%40lambda-middleware%2Futils.svg)](https://npmjs.org/package/@lambda-middleware/utils)
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/lambda-middleware.svg)](https://github.com/dbartholomae/lambda-middleware/issues)
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme)
[![build status](https://github.com/dbartholomae/lambda-middleware/workflows/.github/workflows/build.yml/badge.svg?branch=main)](https://github.com/dbartholomae/lambda-middleware/actions?query=workflow%3A.github%2Fworkflows%2Fbuild.yml)
[![codecov](https://codecov.io/gh/dbartholomae/lambda-middleware/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/lambda-middleware)
[![dependency status](https://david-dm.org/dbartholomae/lambda-middleware.svg?theme=shields.io)](https://david-dm.org/dbartholomae/lambda-middleware)
[![devDependency status](https://david-dm.org/dbartholomae/lambda-middleware/dev-status.svg)](https://david-dm.org/dbartholomae/lambda-middleware?type=dev)

A collection of utilities for middleware for AWS lambda functions.

## Lambda middleware

These utilities are part of the [lambda middleware series](https://dbartholomae.github.io/lambda-middleware/). They can be used independently.

## Production utils

### promisifyHandler

Converts a handler that can either use a callback or return a `Promise`
to a handler that is only `Promise` based.

### PromiseHandler

This type is for a handler function that does not take a callback,
but instead returns a promise for the response.

## Test utils

### createEvent

Creates an `APIGatewayEvent` for testing.
Currently does not implement `requestContext`.

### createContext

Creates an AWS Lambda `Context` for testing.
Currently does not implement `done`, `fail`, `getRemainingTimeInMillis` and `succeed`.
npm package: @lambda-platform/cli
Description: lambda cli
Latest version: 0.0.30

# Lambda CLI

Installation: `npm i -g @lambda-platform/cli`

Usage: `lambda <command> [options]`

Options:<br/>
  `-v, --version`                 output the version number<br/>
  `-h, --help`                    output usage information

Commands:<br/>
  `lambda c, create [options] <app-name>`   create a new project powered by lambda-cli
  `lambda pro, create-pro [options] <app-name>`   create a new Pro Project powered by lambda-cli

Examples:<br/>
  `lambda create my-app, lambda c my-app, lambda create-pro my-app, lambda pro myapp`