Socket
Socket
Sign inDemoInstall

utility-lambda-api-handler-node

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utility-lambda-api-handler-node

A generic node package for handling lambda request events in a more predictable and concise fashion


Version published
Weekly downloads
3
increased by50%
Maintainers
2
Weekly downloads
 
Created
Source

utility-lambda-api-handler-node

A generic node package for handling lambda request events in a more predictable and concise fashion

This package is dependent on Joi for the validation

parseEvent

API

parseEvent(event[, validationSchema])

Example

Input:

parseEvent({
  body: `{"foo": "bar"}`,
  queryStringParameters: {
    'bing': 'bong'
  },
  pathParameters: {
    'rasp': 'berry'
  }
}, {
  body: Joi.object().keys({
    foo: Joi.string().required()
  })
})

Output:

{
  errors: null,
  event: {
    body: ...,
    queryParameters: ...,
    pathParameters: ...
  }
}

respond

Input:

respond([statusCode][, message][, errors][, headers])

Output

{
  statusCode: ...,
  body: message(stringified),
  headers: ...
}

FAQs

Package last updated on 28 Mar 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc