7.2.0 • Published 1 day ago

@skyleague/event-horizon v7.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 day ago

Event Horizon (@skyleague/event-horizon)

I propose that the information is stored not in the interior of the black hole as one might expect, but on its boundary, the event horizon

  • Stephen Hawking

Event Horizon simplifies doing the right thing with AWS lambda handlers. It tries to do as little as possible, and adds little functionality:

  • Typing & validation on handler input and output.
  • Sane and configurable error handling depending on the event source.
  • Exposes loggers, tracing and metrics functionality.
  • A standardized way of injecting dependencies in the cold start of lambdas.
  • Out of the box AWS X-Ray integration.
  • OpenAPI documentation generation.
  • Tries to stay out of your way as much as possible.

Notably, Event Horizon is not an http framework. Routing is outside of the scope of this library. Replacing the library with something else shouldn't be hard due to its limited functionality.

Documentation

The documentation can be found here.

Install

Use npm to install event-horizon and the event-horizon-cli

npm i @skyleague/event-horizon

Handlers

HTTP

An example http handler:

export const handler = httpHandler({
    http: {
        method: 'post',
        path: '/pet',
        schema: {
            body: Pet,
            responses: {
                200: Pet,
            },
        },
        handler: ({ body }, { logger }) => {
            logger.info('Request received', {
                foo: 'bar',
            })

            return {
                statusCode: 200,
                body: body,
            }
        },
    },
})

Local Development

Install Event Horizon CLI module

npm i @skyleague/event-horizon-dev

Usage

In the examples folder you will find a pet-store application which you can run.

event-horizon-dev start examples/pet-store/functions/index.ts | npx pino-pretty -m message

Two local endpoints will become available on http://localhost:3000

http://localhost:3000/pet and http://localhost:3000/pet/findByStatus

Logs will be available in your terminal.

Alternative projects

In no particular order, the following libraries try to solve similar problems (albeit very differently):

PR's are very welcome if you think your project is missing here.

Support

SkyLeague provides Enterprise Support on this open-source library package at clients across industries. Please get in touch via https://skyleague.io.

If you are not under Enterprise Support, feel free to raise an issue and we'll take a look at it on a best-effort basis!

License & Copyright

This library is licensed under the MIT License (see LICENSE.md for details).

If you using this SDK without Enterprise Support, please note this (partial) MIT license clause:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND

Copyright (c) 2022, SkyLeague Technologies B.V.. 'SkyLeague' and the astronaut logo are trademarks of SkyLeague Technologies, registered at Chamber of Commerce in The Netherlands under number 86650564.

All product names, logos, brands, trademarks and registered trademarks are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, trademarks and brands does not imply endorsement.

7.2.0

1 day ago

7.0.6

3 days ago

7.1.0

3 days ago

7.0.5

18 days ago

7.0.4

18 days ago

7.0.0

22 days ago

7.0.3

22 days ago

7.0.2

22 days ago

7.0.1

22 days ago

6.0.1

4 months ago

6.0.0

5 months ago

5.0.7

6 months ago

5.0.6

7 months ago

5.0.5

7 months ago

5.0.4

7 months ago

5.0.3

8 months ago

5.0.2

8 months ago

5.0.1

8 months ago

5.0.0

8 months ago

5.1.0

5 months ago

4.2.2

10 months ago

4.2.1

11 months ago

4.2.0

12 months ago

4.1.3

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.2

1 year ago

4.0.0-beta.0

1 year ago

4.1.0

1 year ago

4.1.2

1 year ago

4.1.1

1 year ago

3.3.1

1 year ago

2.4.1

1 year ago

2.2.3

1 year ago

2.4.0

1 year ago

2.2.4

1 year ago

3.2.0

1 year ago

3.0.0

1 year ago

2.3.0

1 year ago

2.3.1

1 year ago

3.3.0

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.25.0

2 years ago

1.23.0

2 years ago

1.23.1

2 years ago

1.27.0

1 year ago

1.27.1

1 year ago

2.1.0

1 year ago

1.26.0

2 years ago

1.22.1

2 years ago

1.24.0

2 years ago

1.26.1

2 years ago

1.26.2

2 years ago

1.22.0

2 years ago

1.21.1

2 years ago

1.21.0

2 years ago

1.20.0

2 years ago

1.19.1

2 years ago

1.19.0

2 years ago

1.18.0

2 years ago

1.17.5

2 years ago

1.17.4

2 years ago

1.17.3

2 years ago

1.17.2

2 years ago

1.17.1

2 years ago

1.17.0

2 years ago

1.16.1

2 years ago

1.16.0

2 years ago

1.15.2

2 years ago

1.15.1

2 years ago

1.15.0

2 years ago

1.14.0

2 years ago

1.13.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.10.1

2 years ago

1.10.0

2 years ago

1.9.8

2 years ago

1.9.7

2 years ago

1.9.6

2 years ago

1.9.5

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.2

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

1.8.1

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago