🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-lambda

Detect if your code is running on an AWS Lambda server

1.0.1
latest
Version published
Weekly downloads
12M
1.31%
Maintainers
1
Weekly downloads
 
Created

What is is-lambda?

The is-lambda npm package is designed to help developers determine if their code is running in an AWS Lambda environment. This can be particularly useful for writing code that needs to behave differently when run in a Lambda function versus other environments, such as on a local development machine or a different cloud platform. The package provides a simple interface to check the execution environment.

What are is-lambda's main functionalities?

Check if running in AWS Lambda

This feature allows developers to programmatically determine if their code is executing within an AWS Lambda environment. The code sample demonstrates how to use the is-lambda package to check the environment and print a message accordingly.

const isLambda = require('is-lambda');

if (isLambda) {
  console.log('Running in AWS Lambda');
} else {
  console.log('Not running in AWS Lambda');
}
0

FAQs

Package last updated on 24 May 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