🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js
Building Lambda functions with Node.js - AWS Lambda
You can run JavaScript code with Node.js in AWS Lambda. Lambda provides runtimes for Node.js that run your code to process events. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management (IAM) role that you manage.
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js › define lambda function handler in node.js
Define Lambda function handler in Node.js - AWS Lambda
You can configure Node.js in Lambda to detect automatically whether a .js file should be treated as CommonJS or as an ES module by adding the —experimental-detect-module flag to the NODE_OPTIONS environment variable. For more information, see Experimental Node.js features.
Discussions

Why would I use Node.js in Lambda? Node main feature is handling concurrent many requests. If each request to lambda will spawn a new Node instance, whats the point?
That’s not really unique to Node. The majority of languages and web app platforms have concurrency mechanisms that will process multiple requests simultaneously. That is certainly a drawback of Lambda if you’re looking at raw CPU cycle efficiency and your application spends a lot of time waiting on synchronous downstream calls, but in most cases that doesn’t really matter. In practice, there are a lot of apps that can either use really fast data stores like Dynamo or use asynchronous processing models that minimize the amount of idle CPU time for a given request. Also, even with some inefficiencies when looking at high concurrency time periods, sometimes the ability for Lambda to immediately scale down during troughs in your load pattern makes up for it when looking at the global efficiency of the system (especially when you consider other operational overhead like patching servers.) Bottom line, people use Node with Lambda because they like the language and are familiar with it. Using the same language for the front end browser code and the backend is nice for teams that build full stack web apps. More on reddit.com
🌐 r/aws
82
56
February 8, 2020
Go Lambda vs Node.js Lambda vs Python Lambda
Generally Lambda is so cheap to run (even at scale) that you wouldn’t really care about the margin speed difference until you had so many customers that an entire team could be assigned to optimize and refactor. Speed of initial delivery is more important here - move fast w the language you’re most proficient in! That said, if you still believe it’s really important now, there have been a ton of comparisons already that should be easy to find w your favorite search engine. Finally, if it really really really matters to you, what are your findings for a prototype? There are a lot of dependencies based on what your code will do that can’t be predicted as easily as “what is fastest”. More on reddit.com
🌐 r/serverless
8
2
August 27, 2022
AWS Lambda: Python vs Nodejs
Having done quite a bit of lambda development over the last several years, it really does come down to the personal preference of you and/or your team. Pick the language you feel most comfortable with, that you want to support as a team going forward for X number of years. Both Python and Nodejs are quite popular languages for lambda development. More on reddit.com
🌐 r/aws
15
16
February 19, 2021
How to upload a Lambda function with Node.js SDKs and dependencies?
Try this search for more information on this topic. Comments, questions or suggestions regarding this autoresponse? Please send them here . I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/aws
6
3
February 1, 2025
🌐
AWS
aws.amazon.com › blogs › compute › node-js-24-runtime-now-available-in-aws-lambda
Node.js 24 runtime now available in AWS Lambda | Amazon Web Services
November 25, 2025 - You can now develop AWS Lambda functions using Node.js 24, either as a managed runtime or using the container base image. Node.js 24 is in active LTS status and ready for production use.
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › lambda runtimes
Lambda runtimes - AWS Lambda
For functions with more complex computation, compiled languages like Java are often slower to initialize but run quickly in the Lambda handler. Choice of runtime is also influenced by developer preference and language familiarity. Each major programming language release has a separate runtime, with a unique runtime identifier, such as nodejs24.x or python3.14. To configure a function to use a new major language version, you need to change the runtime identifier. Since AWS Lambda cannot guarantee backward compatibility between major versions, this is a customer-driven operation.
🌐
GitHub
github.com › aws › aws-lambda-nodejs-runtime-interface-client
GitHub - aws/aws-lambda-nodejs-runtime-interface-client: AWS Lambda Runtime Interface Client for Node.js · GitHub
This package implements the AWS Lambda Runtime Interface Client (RIC) for Node.js.
Starred by 220 users
Forked by 61 users
Languages   TypeScript 91.1% | Shell 3.9% | JavaScript 2.5% | C++ 1.8% | Python 0.4% | M4 0.2% | Makefile 0.1%
🌐
AWS
aws.amazon.com › about-aws › whats-new › 2025 › 11 › aws-lambda-nodejs-24
AWS Lambda adds support for Node.js 24 - AWS
AWS Lambda now supports creating serverless applications using Node.js 24. Developers can use Node.js 24 as both a managed runtime and a container base image, and AWS will automatically apply updates to the managed runtime and base image as they become available.
🌐
AWS
docs.aws.amazon.com › cdk › api › v2 › docs › aws-cdk-lib.aws_lambda_nodejs-readme.html
aws-cdk-lib.aws_lambda_nodejs module · AWS CDK
When using NODEJS_LATEST runtime make sure that all of your dependencies are included during bundling, or as layers. Usage of globally installed packages in the lambda environment may cause your function to break in future versions. If you need to rely on packages pre-installed in the lambda environment, you must explicitly set your runtime. ... import { Runtime } from 'aws-cdk-lib/aws-lambda'; new nodejs.NodejsFunction(this, 'my-function', { runtime: Runtime.NODEJS_LATEST, });
🌐
AWS
docs.aws.amazon.com › cdk › api › v2 › python › aws_cdk.aws_lambda_nodejs › README.html
Amazon Lambda Node.js Library — AWS Cloud Development Kit 2.248.0 documentation
When using NODEJS_LATEST runtime make sure that all of your dependencies are included during bundling, or as layers. Usage of globally installed packages in the lambda environment may cause your function to break in future versions. If you need to rely on packages pre-installed in the lambda environment, you must explicitly set your runtime. ... from aws_cdk.aws_lambda import Runtime nodejs.NodejsFunction(self, "my-function", runtime=Runtime.NODEJS_LATEST )
Find elsewhere
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js › deploy node.js lambda functions with .zip file archives
Deploy Node.js Lambda functions with .zip file archives - AWS Lambda
Your AWS Lambda function’s code comprises a .js or .mjs file containing your function’s handler code, together with any additional packages and modules your code depends on. To deploy this function code to Lambda, you use a deployment package . This package may either be a .zip file archive ...
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js › instrumenting node.js code in aws lambda
Instrumenting Node.js code in AWS Lambda - AWS Lambda
To avoid uploading runtime dependencies every time you update your function code, package the X-Ray SDK in a Lambda layer. The following example shows an AWS::Serverless::LayerVersion resource that stores the AWS X-Ray SDK for Node.js. Resources: function: Type: AWS::Serverless::Function Properties: CodeUri: function/. Tracing: Active Layers: - !Ref libs ... libs: Type: AWS::Serverless::LayerVersion Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app.
🌐
Stackify
stackify.com › aws-lambda-with-node-js-a-complete-getting-started-guide
AWS Lambda with Node.js: A Complete Getting Started Guide - Stackify
May 1, 2023 - # filename: serverless.yml service: ImageUploaderService # The `provider` block defines where your service will be deployed custom: bucket: getting-started-lambda-example provider: name: aws runtime: nodejs8.10 region: eu-west-1 stackName: imageUploader iamRoleStatements: - Effect: "Allow" Action: - "s3:PutObject" Resource: - "arn:aws:s3:::${self:custom.bucket}/*" # The `functions` block defines what code to deploy functions: UploadImage: handler: uploadImage.handler # The `events` block defines how to trigger the uploadImage.handler code events: - http: path: upload method: post cors: true environment: Bucket: ${self:custom.bucket} resources: Resources: StorageBucket: Type: "AWS::S3::Bucket" Properties: BucketName: ${self:custom.bucket}
🌐
Docker Hub
hub.docker.com › r › amazon › aws-lambda-nodejs
amazon/aws-lambda-nodejs - Docker Image
These base images contain the Amazon Linux Base operating system, the runtime for a given language, dependencies and the Lambda Runtime Interface Client (RIC), which implements the Lambda Runtime API⁠. The Lambda Runtime Interface Client allows your runtime to receive requests from and send requests to the Lambda service. To learn more about the composition of the base images you can visit https://github.com/aws/aws-lambda-base-images⁠.
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js › working with layers for node.js lambda functions
Working with layers for Node.js Lambda functions - AWS Lambda
Lambda functions run on Amazon Linux. You can create layers that contain either third-party Node.js libraries installed with npm (such as axios or lodash) or your own JavaScript modules. Create the required directory structure and install packages directly into it: mkdir -p nodejs npm install ...
🌐
npm
npmjs.com › package › @aws-cdk › aws-lambda-nodejs
@aws-cdk/aws-lambda-nodejs - npm
By default, all node modules are bundled except for aws-sdk. This can be configured by specifying bundling.externalModules: new lambda.NodejsFunction(this, 'my-handler', { bundling: { externalModules: [ 'aws-sdk', // Use the 'aws-sdk' available in the Lambda runtime 'cool-module', // 'cool-module' is already available in a Layer ], }, });
      » npm install @aws-cdk/aws-lambda-nodejs
    
Published   Jun 19, 2023
Version   1.204.0
Author   Amazon Web Services
🌐
AWS re:Post
repost.aws › knowledge-center › lambda-layer-aws-sdk-latest-version
Integrate the AWS SDK for JavaScript into a Node.js Lambda function | AWS re:Post
April 28, 2025 - docker run --entrypoint "" -v "$PWD":/var/task "public.ecr.aws/lambda/nodejs:<version>" /bin/sh -c "npm install aws-sdk; exit"
🌐
GeeksforGeeks
geeksforgeeks.org › devops › aws-lambda-function-handler-in-nodejs
AWS Lambda Function Handler in Node.js - GeeksforGeeks
July 23, 2025 - Type: AWS::Serverless::Function · Properties: Handler: index.handler · Runtime: nodejs14.x · CodeUri: . Description: A simple Lambda function · Now, run the command. sam local invoke MyLambdaFunction --event event.json · The handler is the entry point for your AWS Lambda function.
🌐
Medium
medium.com › @tombray › getting-started-with-aws-lambda-node-js-904bc0bfb83
Getting Started with AWS Lambda (Node JS) | by Tom Bray | Medium
January 10, 2016 - Getting Started with AWS Lambda (Node JS) In this article I’ll walk you through creating a Lambda the easy way, using the AWS Console. At the end I provide links to gulp projects that will help you …
🌐
AWS
aws.amazon.com › blogs › compute › node-js-20-x-runtime-now-available-in-aws-lambda
Node.js 20.x runtime now available in AWS Lambda | Amazon Web Services
November 15, 2023 - You can now develop AWS Lambda functions using the Node.js 20 runtime. This Node.js version is in active LTS status and ready for general use. To use this new version, specify a runtime parameter value of nodejs20.x when creating or updating ...
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js › using the lambda context object to retrieve node.js function information
Using the Lambda context object to retrieve Node.js function information - AWS Lambda
When Lambda runs your function, it passes a context object to the handler . This object provides methods and properties that provide information about the invocation, function, and execution environment.
🌐
Reddit
reddit.com › r/aws › why would i use node.js in lambda? node main feature is handling concurrent many requests. if each request to lambda will spawn a new node instance, whats the point?
r/aws on Reddit: Why would I use Node.js in Lambda? Node main feature is handling concurrent many requests. If each request to lambda will spawn a new Node instance, whats the point?
February 8, 2020 -

Maybe I'm missing something here, from an architectural point of view, I can't wrap my head on using node inside a lambda. Let's say I receive 3 requests, a single node instance would be able to handle this with ease, but if I use lambda, 3 lambdas with Node inside would be spawned, each would be idle while waiting for the callback.

Edit: Many very good answers. I will for sure discuss this with the team next week. Very happy with this community. Thanks and please keep them coming!

Top answer
1 of 27
29
That’s not really unique to Node. The majority of languages and web app platforms have concurrency mechanisms that will process multiple requests simultaneously. That is certainly a drawback of Lambda if you’re looking at raw CPU cycle efficiency and your application spends a lot of time waiting on synchronous downstream calls, but in most cases that doesn’t really matter. In practice, there are a lot of apps that can either use really fast data stores like Dynamo or use asynchronous processing models that minimize the amount of idle CPU time for a given request. Also, even with some inefficiencies when looking at high concurrency time periods, sometimes the ability for Lambda to immediately scale down during troughs in your load pattern makes up for it when looking at the global efficiency of the system (especially when you consider other operational overhead like patching servers.) Bottom line, people use Node with Lambda because they like the language and are familiar with it. Using the same language for the front end browser code and the backend is nice for teams that build full stack web apps.
2 of 27
12
> if I use lambda, 3 lambdas with Node inside would be spawned, each would be idle while waiting for the callback This is true of any other language, though. You could have three instances of a program written in Assembly waiting for data to return. > I can't wrap my head on using node inside a lambda The reasons to adopt Node over other platforms are varied, and not necessarily technical arguments. Node has fast startup times compared with .Net or Java. AWS themselves recommend Node in use-cases where cold-start latency matters; eg. web handlers. Most business applications are IO-bound. It doesn't matter which language you pick if you're sat waiting for data to return over the network. Javascript is easy to hire for - it's a lingua franca that most engineers have some skill with Modern front-end frameworks often support server-side rendering, which makes a single language attractive across the entire stack. As a result of the above, JS is the default option for Lambda, which means the best tooling and libraries are written for JS, compounding the advantages and mind-share. Architecture isn't really about making the best technical choice, it's about making the right _business_ decision in a technical context so that your choices support one another.