Published on Jan 28, 2023
Node.js version 18 is now supported in AWS’ Function as a Service (FaaS), AWS Lambda, and is in active LTS status.
It is now possible for developers to implement AWS Lambda functions using Node.js 18’s new language features, such as improved performance for class fields and private class methods, JSON import assertions, and experimental features such as the Fetch API, Test Runner module, and Web Streams API.
In Node.js 18, the global fetch API is available by default; one of the experimental features includes a fetch function, which eliminates the need for fetch polyfills and third-party HTTP packages
Using the NODE_OPTIONS environment variable, experimental features can be enabled or disabled.
When creating or updating functions or using the appropriate managed runtime base image, developers can specify the runtime parameter value of nodejs18.x when using AWS Lambda’s current Long Term Support (LTS) version of Node.js.
The Node.js 18 runtime is also supported by functions running on either Arm-based AWS Graviton2 or x86-based processors.
Previously, the Node.js runtime available in AWS Lambda was 16 and was in Maintenance LTS since mid-October 2022. A year from now, it will reach the end of its useful life.
Lambda’s Node.js runtimes have included AWS SDK for JavaScript version 2 until Node.js 16, which has been upgraded to AWS SDK for JavaScript version 3 with Node.js 18. Thus, developers upgrading to Node.js 18 can update their function code to use the SDK v3 – the recommended method, according to the company. Alternatively, developers may deploy the SDK v2 and their function code without updating their existing code in order to use the Node.js 18 runtime.
Another change in Node.js 18 is the addition of support for ES module resolution via the NODE_PATH environment variable. When loading ES modules from Lambda layers, the runtime searches the folders listed in NODE_PATH, making it easier to include the AWS SDK as an ES module.
AWS Lambda support for Node.js 18 has been welcomed by the community and developers.
Finally, the AWS Lambda documentation provides more information about writing functions in Node.js 18. Moreover, developers can migrate their existing Node.js functions to the new runtime by changing the runtime configuration to nodejs16.x after reviewing the code for compatibility issues.
Presentations
Browse LSET presentations to understand interesting…
Explore Now
eBooks
Get complete guides to empower yourself academically…
Explore Now
Infographics
Learn about information technology and business…
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
[wpforms id=”9030″]