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
is-lambda
Returns true
if the current environment is an AWS
Lambda server.

Installation
npm install is-lambda
Usage
var isLambda = require('is-lambda')
if (isLambda) {
console.log('The code is running on a AWS Lambda')
}
License
MIT