BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News AWS Lambda Now Has Support for Node.js 16 Runtime

AWS Lambda Now Has Support for Node.js 16 Runtime

This item in japanese

Recently AWS announced that Node.js version 16 supports its Function as a Service (FaaS) AWS Lambda and is in active LTS status (ready for general use).

Developers can now author AWS Lambda functions using Node.js' new features, such as toolchain and compiler upgrades (including prebuilt binaries for Apple Silicon), stable timers promises API, and RegExp match indices, and faster calls with argument size mismatch.

AWS Lambda supports the current Long Term Support (LTS) version of Node.js, which means developers who want to use the new versions need to specify a runtime parameter value of nodejs16.x when creating or updating functions or by using the appropriate managed runtime base image. Furthermore, the Node.js 16 runtime is supported by functions running on either Arm-based AWS Graviton2 processors or x86-based processors.

The Node.js 16 version includes support for ES modules and top-level await added to the Node.js 14 runtime in January 2022, which is useful when used with Provisioned Concurrency to reduce cold start times. 

The Node.js 16 managed runtimes and container base images bundle the AWS JavaScript SDK version 2. Dan Fox, principal specialist solutions architect, Serverless at AWS, explains the benefit of the SDK in a recent AWS Compute blog post:

Using the bundled SDK is convenient for a few use cases. For example, developers writing short functions via the Lambda console or inline functions via CloudFormation templates may find it useful to reference the bundled SDK.

Earlier, the Node.js runtime available in AWS Lambda was 14 and has been in Maintenance LTS since October 2021. It will reach the end of life in eleven months.


Source: https://nodejs.org/en/about/releases/

Kenneth Falck, principal cloud architect, tweeted:

Nice to see Lambda finally support Node 16. However, I'm not very happy knowing my 14.x functions will eventually deprecate. I wish there was an evergreen platform that would just auto upgrade behind the scenes like web browsers do. WebAssembly for Lambda?

In addition, the company acknowledges the late release of the Node.js 16 runtime for Lambda, and a respondent on a Reddit thread stated:

Just words for now, sure. But I don't read self-criticism in AWS announcements often (actually can't remember any) and am therefore inclined to believe they will improve in that regard.

And others in the thread hope for a release soon of Python 3.10 and Ruby 3. x.

Lastly, the Node.js programming model in the AWS Lambda documentation provides more details about writing functions in Node.js 16. Furthermore, developers can migrate their existing Node.js functions to the new runtime by changing its runtime configuration to nodejs16.x after reviewing the code for compatibility issues.

About the Author

Rate this Article

Adoption
Style

BT