JSPM

lambda-nodejs-response-helper

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 10
    • Score
      100M100P100Q56049F
    • License MIT

    Helper functions to create response objects for AWS Lambda

    Package Exports

    • lambda-nodejs-response-helper

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambda-nodejs-response-helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Response helpers for AWS Lambda (nodejs)

    Helper functions to create response objects for AWS Lambda

    Installation

    npm install --save github:egeniq/lambda-nodejs-response-helper

    Usage

    'use strict';
    
    const {createJsonResponse} = require('lambda-nodejs-response-helper');
    
    module.exports.hello = async (event) => {
      return createJsonResponse(
        200,
        {
          message: 'Go Serverless v1.0! Your function executed successfully!',
          input: event,
        },
        {
          'X-Custom-Header': 'Foobar'
        }
      );
    };