
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
functioneer-aws
Advanced tools
Helper functions for Functioneer - for use with AWS Lambda functions.
Run npm install i functioneer-aws
and import to your project.
Declare a function:
import {Functioneer} from "functioneer";
const func = new Functioneer();
//Declare a function to add two numbers
func.registerFunction("add", "Adds two numbers", (a: number, b: number) => {
return a + b;
})
.addField("a", "number", "The first number to add")
.addField("b", "number", "The second number to add");
Use the lambda handler for a path:
import { getLamdaHandler } from "./lib/functioneer-aws";
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
export const lambdaHandler: (event: APIGatewayProxyEvent) => Promise<APIGatewayProxyResult> = getLamdaHandler(func,"BODY");
getLambdaHandler(functioneerInstance,dataSource,functionName?)
arguement | type | |
---|---|---|
functioneerInstance | Functioneer | An instance of Functioneer |
dataSource | string | Where to get the function arguements from ("BODY" or "PARAMS" or "QUERY") |
functionName | string? | The function to be called. If null then select the function name from the data source |
As mentioned before you can either hardcode the function to run or parse it through the dataSource:
const func = new Functioneer();
func.registerFunction("add", "Adds two numbers", (a: number, b: number) => { return a + b; }).
addField("a", "number", "The first number to add").
addField("b", "number", "The second number to add");
// This will run the add function
export const lambdaHandler: (event: APIGatewayProxyEvent) => Promise<APIGatewayProxyResult> = getLamdaHandler(func,"BODY", "add");
// This will run any function specified in body.functionName
export const lambdaHandler: (event: APIGatewayProxyEvent) => Promise<APIGatewayProxyResult> = getLamdaHandler(func,"BODY");
The following data sources are supported:
Data source | value | |
---|---|---|
Request body | "BODY" | JSON data from request body |
URL parameters | "PARAMS" | URL parameters |
Query string | "QUERY" | Query string parameters |
You can build the project by running npm run build
.
Tests are run by running npm run test
Functioneer-aws is licensed under MIT license
FAQs
AWS lambda helpers for functioneer.
The npm package functioneer-aws receives a total of 1 weekly downloads. As such, functioneer-aws popularity was classified as not popular.
We found that functioneer-aws demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.