lambda-node-utility

0.0.8 • Public • Published

lambda-utils

A utility library for Lambda and Node.js development.

This will be a growing collection of helper methods I encounter while using the serverless stack.

Methods

convertAWSObjectToFlatObject

This converts a DynamoDb image passed through an event to a flat object that we can use to send to other services

input: { name: { S: "Lambda" } }

output: { name: "Lambda" }

convertObjectToLowerCaseKeys

This converts an object to lowercase keys so we can update services like Amazon CloudSearch

input: { Name: "Lambda" }

output: { name: "Lambda" }

generateDynamoUpdateExpr

This converts an object into an update expression for updating dynamo db. You can also pass in a list of columns to exclude from the update, for example hash or range keys.

input: { name: { S: "Lambda" } }

output: { UpdateExpression: "set name = :a1", ExpressionAttributeValues: { ":a1": "Lambda" }, Count: 1 }

Readme

Keywords

none

Package Sidebar

Install

npm i lambda-node-utility

Weekly Downloads

3

Version

0.0.8

License

ISC

Last publish

Collaborators

  • brianfoody