News/Tech News

AWS Lambda Now Has Support for Node.js 18 Runtime

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.

Tech News

Chromium to Allow the Use of Third-Party Rust Libraries to Improve Safety and Security

Chromium to Allow the Use of Third-Party Rust Libraries to Improve Safety and Security

To improve security, safety, and speed up development, the Chromium Project will add a Rust…

Kubernetes Report Finds Increase in Poorly Configured Workloads

Kubernetes Report Finds Increase in Poorly Configured Workloads

Fairwinds, a provider of Kubernetes software, has released its Kubernetes Benchmark Report 2023…

Our Latest Blog

Beyond the Basics Advanced Techniques and Tools for Ethical Hacking Professionals

Beyond the Basics: Advanced Techniques and Tools for Ethical Hacking Professionals

Are you an ethical hacking professional looking to take your skills to the next level?...
Read More
Mastering Full Stack Python Development with Django A Comprehensive Guide

Mastering Full Stack Python Development with Django: A Comprehensive Guide

Python is a powerful programming language that has taken the world of web development by...
Read More
Mastering Machine Learning A Beginner's Guide to Python

Mastering Machine Learning: A Beginner’s Guide to Python

Welcome to the world of machine learning! With the ever-increasing demand for artificial intelligence and...
Read More

Follow Us

Resources

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…

Explore Now