Shared pre / post function code

As the number of functions within an “app” increases, the need for shared code becomes greater, and the burden of maintaining the initialization of the shared code increases…
To alleviate this, it would be good to be able to run a common function before (and potentially after) the function.
Is there any way to accomplish this?

Checkout https://github.com/middyjs/middy it lets you add middleware before/after functions

1 Like