Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
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 9 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.