open-index/open-npm huggingface dataset:
npm package: @sailplane/aws-https
Description: HTTPS client with AWS Signature v4
Author: Rackspace Technology
Latest version: 4.0.0

# @sailplane/aws-http - HTTPS client with AWS Signature v4

## What?

The AwsHttps class is an HTTPS (notice, _not_ HTTP) client purpose made for use in and with AWS environments.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

## Why?

- Simple Promise or async syntax
- Optionally authenticates to AWS via AWS Signature v4 using [aws4](https://www.npmjs.com/package/aws4)
- Familiar [options](https://nodejs.org/api/http.html#http_http_request_options_callback>)
- Helper to build request options from URL object
- Light-weight
- Easily extended for unit testing

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.
npm package: @sailplane/elasticsearch-client
Description: Dead simple client for AWS managed Elasticsearch.
Author: Rackspace Technology
Latest version: 4.0.0

# @sailplane/elasticsearch-client - HTTPS client with AWS Signature v4

## What?

An extremely light-weight client for communicating with AWS Elasticsearch.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

## Why?

Other solutions for communicating with Elasticsearch are either incompatible with AWS,
very heavy weight, or both. This client gets the job done and is as simple as it gets!

- Simple Promise or async syntax
- Authenticates to AWS via AWS Signature v4
- Light-weight

Use it with Elasticsearch's [Document API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs.html).

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.
npm package: @sailplane/expiring-value
Description: Container for a value that is instantiated on-demand (lazy-loaded via factory) and cached for a limited time.
Author: Rackspace Technology
Latest version: 5.0.0

# @sailplane/expiring-value - on-demand value with timeout

## What?

The `ExpringValue` generic class is a container for a value that is instantiated on-demand (lazy-loaded via factory) and cached for a limited
time. Once the cache expires, the factory is used again on next demand to get a fresh version.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

## Why?

`ExpiringValue` is a container for a value that is instantiated on-demand (lazy-loaded via factory)
and cached for a limited time.
Once the cache expires, the factory is used again on next demand to get a fresh version.

In Lambda functions, it is useful to cache some data in instance memory to avoid
recomputing or fetching data on every invocation. In the early days of Lambda, instances only lasted 15 minutes
and thus set an upper-limit on how stale the cached data could be. With instances now seen to last for
many hours, a mechanism is needed to deal with refreshing stale content - thus `ExpiringValue` was born.

`ExpiringValue` is not limited to Lambdas, though. Use it anywhere you want to cache a value for
a limited time. It even works in the browser for client code.

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.
npm package: @sailplane/injector
Description: Simple, light-weight, lazy-instantiating, and type-safe dependency injection in TypeScript.
Author: Rackspace Technology
Latest version: 5.1.0

# @sailplane/injector - Type-safe Dependency Injection

## What?

Simple, light-weight, lazy-instantiating, and type-safe dependency injection in Typescript!
Perfect for use in Lambdas and unit test friendly.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

# Why?

It is built on top of the [BottleJS](https://www.npmjs.com/package/bottlejs), with a simple type-safe
wrapper. The original _bottle_ is available for more advanced use, though. Even if you are not using Typescript,
you may still prefer this simplified interface over using BottleJS directly.

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.
npm package: @sailplane/lambda-utils
Description: Use middleware to remove redundancy in AWS Lambda handlers.
Author: Rackspace Technology
Latest version: 7.0.0

# @sailplane/lambda-utils - Lambda handler middleware

## What?

There's a lot of boilerplate in Lambda handlers.
This collection of utility functions leverage the great [Middy](https://middy.js.org/)
library to add middleware functionality to Lambda handlers.
You can extend it with your own middleware.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

## Why?

Middy gives you a great start as a solid middleware framework,
but by itself you are still repeating the middleware registrations
on each handler, its exception handler only works with errors created by the http-errors package,
and you still have to format your response in the shape required by API Gateway.

`LambdaUtils` takes Middy further and is extendable so that you can add your own
middleware (authentication & authorization, maybe?) on top of it.

Used with API Gateway, the included middlewares:

- Set CORS headers
- Normalize incoming headers to mixed-case
- If incoming content is JSON text, replaces event.body with parsed object
- Ensures that event.queryStringParameters and event.pathParameters are defined, to avoid TypeErrors
- Ensures that handler response is formatted properly as a successful API Gateway result
  - Unique to LambdaUtils!
  - Simply return what you want as the body of the HTTP response
- Catch http-errors exceptions into proper HTTP responses
- Catch other exceptions and return as HTTP 500
  - Unique to LambdaUtils!
  - Besides providing better feedback to the client, not throwing an exception out of your handler means that your
    instance will not be destroyed and suffer a cold start on the next invocation
- Leverages async syntax

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.
npm package: @sailplane/logger
Description: CloudWatch and serverless-offline friendly logger.
Author: Rackspace Technology
Latest version: 6.0.0

# @sailplane/logger - CloudWatch and serverless-offline friendly logger

## What?

Logger adds context and when needed, timestamps and JSON formatting, to log output.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

## Why?

Sadly, `console.log` is the #1 debugging tool when writing serverless code. Logger extends it with levels,
timestamps, context/category names, and object formatting. It's just a few small incremental improvements, and
yet together takes logging a leap forward. It'll do until we can have a usable cloud debugger.

There are far more complicated logging packages available for Javascript;
but sailplane is all about simplicity, and this logger gives you all that
you really need without the bulk.

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.
npm package: @sailplane/state-storage
Description: Serverless state and configuration storage
Author: Rackspace Technology
Latest version: 4.0.0

# @sailplane/state-storage - Serverless state and configuration storage

## What?

StateStorage is a simple wrapper for SSM `getParameter` and `putParameter` functions, abstracting it into
a contextual storage of small JSON objects.

This is part of the [sailplane](https://github.com/rackspace/sailplane) library of
utilities for AWS Serverless in Node.js.

## Why?

The AWS Parameter Store (SSM) was originally designed as a place to store configuration. It turns out that
it is also a pretty handy place for storing small bits of state information in between serverless executions.

Why use this instead of AWS SSM API directly?

- Simple Promise or async syntax
- Automatic object serialization/deserialization
- Logging
- Consistent naming convention

## How?

See the [docs](https://github.com/rackspace/sailplane/blob/master/README.md) for usage and examples.