New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

json-config-lambda-handler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-config-lambda-handler

Lambda function wrapper to load config from JSON environment variable (with optional KMS encryption)

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

json-config-lambda-handler

const withConfig = require('json-config-lambda-handler');

function handleEvent({ event, config }, callback) {
  console.log('event = ', event);
  console.log('config = ', config);
  callback(null);
}

exports.handle = withConfig(handleEvent);

module.exports(handler)

  • handler <Function> called when the handler is invoked
    • args <Object>
      • event <Object> AWS Lambda uses this parameter to pass in event data to the handler
      • context <Context Object> AWS Lambda context object
      • config <Object> parsed JSON configuration
    • callback <Function> invoke to return info back to caller
      • error <Error> an optional parameter that you can use to provide results of the failed Lambda function execution. When a Lambda function succeeds, you can pass null as the first parameter.
      • result <Object> an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. If an error is provided, this parameter is ignored.

module.exports(environmentVariable, handler)

  • environmentVariable <String> an optional parameter containing environment variable name used to store the configuration. If not used, a default value of CONFIG is used.
  • handler <Function> called when the handler is invoked
    • args <Object>
      • event <Object> AWS Lambda uses this parameter to pass in event data to the handler
      • context <Context Object> AWS Lambda context object
      • config <Object> parsed JSON configuration
    • callback <Function> invoke to return info back to caller
      • error <Error> an optional parameter that you can use to provide results of the failed Lambda function execution. When a Lambda function succeeds, you can pass null as the first parameter.
      • result <Object> an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. If an error is provided, this parameter is ignored.

FAQs

Package last updated on 27 Apr 2017

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