Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-lambda

Package Overview
Dependencies
Maintainers
5
Versions
438
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-lambda

AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native

  • 3.622.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3M
decreased by-8.88%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/client-lambda?

The @aws-sdk/client-lambda package is a client library for AWS Lambda that allows developers to interact with the AWS Lambda service programmatically. It provides methods to create, update, delete, and invoke Lambda functions, as well as manage function configurations, aliases, and versions.

What are @aws-sdk/client-lambda's main functionalities?

Invoke a Lambda function

This feature allows you to invoke an AWS Lambda function with optional payload. The response includes the result of the function execution.

{"const { LambdaClient, InvokeCommand } = require('@aws-sdk/client-lambda');
const client = new LambdaClient({ region: 'us-west-2' });
const params = {
  FunctionName: 'my-lambda-function',
  Payload: Buffer.from(JSON.stringify({ key: 'value' }))
};
const command = new InvokeCommand(params);
client.send(command).then((response) => {
  console.log(response);
}).catch((error) => {
  console.error(error);
});"}

Create a Lambda function

This feature allows you to create a new AWS Lambda function by specifying the code, function name, handler, role, and runtime.

{"const { LambdaClient, CreateFunctionCommand } = require('@aws-sdk/client-lambda');
const client = new LambdaClient({ region: 'us-west-2' });
const params = {
  Code: { /* code properties */ },
  FunctionName: 'my-new-function',
  Handler: 'index.handler',
  Role: 'arn:aws:iam::123456789012:role/lambda-role',
  Runtime: 'nodejs12.x'
};
const command = new CreateFunctionCommand(params);
client.send(command).then((response) => {
  console.log(response);
}).catch((error) => {
  console.error(error);
});"}

List Lambda functions

This feature allows you to list all of your AWS Lambda functions in a specific region.

{"const { LambdaClient, ListFunctionsCommand } = require('@aws-sdk/client-lambda');
const client = new LambdaClient({ region: 'us-west-2' });
const command = new ListFunctionsCommand({});
client.send(command).then((response) => {
  console.log(response.Functions);
}).catch((error) => {
  console.error(error);
});"}

Other packages similar to @aws-sdk/client-lambda

FAQs

Package last updated on 01 Aug 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