
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
lambda-wrap
Advanced tools
Return new error object.
Kind: global class
LambdaWrap
constructor. You can pass options to override or assign new
attributes to event
object. For example add custom headers:
const headers = {
'X-Auth-Token': 'my-token'
};
const wrap = new LambdaWrap({ headers });
It returns an instance of LambdaWrap
- wrap
object. This object can
be used for specifying additional properties:
wrap.responseHandler = customResponseFunction;
Finally, wrap
object can be used as a function to wrap any generator
function and thus create lambda handler:
const handler = wrap(customGeneratorFunction);
Returns: Object
- - New instance of LambdaWrap
.
Param | Type | Default | Description |
---|---|---|---|
[options] | Object | {} | Use to override or assign new attributes to event object. E.g. headers. |
function
Kind: inner method of LambdaWrap
Returns: function
- - Lambda handler.
Param | Type | Description |
---|---|---|
fn | function | Function to be wrapped and used as a lambda handler. |
Override default response function
Kind: static property of wrap
Override default error response function
Kind: static property of wrap
Override default logger object - console
.
MUST implement log
and error
methods.
Kind: static property of wrap
Add new middleware.
Kind: static method of wrap
Param | Type | Description |
---|---|---|
fn | function | Middleware function. |
Add new catch.
Kind: static method of wrap
Param | Type | Description |
---|---|---|
fn | function | Catch function. |
Return new error object.
Kind: global function
Param | Type | Description |
---|---|---|
message | string | Error message. |
code | integer | Error code. |
FAQs
AWS Serverless wrapper for async generators
The npm package lambda-wrap receives a total of 8 weekly downloads. As such, lambda-wrap popularity was classified as not popular.
We found that lambda-wrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.