{"id":76254,"date":"2024-04-25T17:08:00","date_gmt":"2024-04-25T21:08:00","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/blog\/?p=76254"},"modified":"2024-04-29T07:16:08","modified_gmt":"2024-04-29T11:16:08","slug":"nodejs22-release","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/","title":{"rendered":"What\u2019s New in Node.js 22: Exciting Features and Updates"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-1024x538.png\" alt=\"What\u2019s New in Node.js 22: Exciting Features and Updates\" class=\"wp-image-76256\" srcset=\"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-300x158.png 300w, https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-768x403.png 768w, https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/nodejs\/\" target=\"_blank\" rel=\"noreferrer noopener\">Node.js<\/a>, the powerful and popular JavaScript runtime, has released its latest version\u2014Node.js 22. In this release, three major updates stand out: the enhanced capability to <code>require()<\/code> ECMAScript modules (ESM) within CommonJS modules, the introduction of a built-in WebSocket client, and the latest updates to the V8 JavaScript engine. Let&#8217;s explore these updates and more! <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Main Updates for Node.js 22<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Enhanced <code>require()<\/code> for ECMAScript Modules<\/h3>\n\n\n\n<p>Node.js 22 bridges the gap between CommonJS and ECMAScript modules by enabling the <code>require()<\/code> function to import ESM modules directly. The new version allows for synchronous ECMAScript modules to be <code>require()<\/code>d under the <code>--experimental-require-module<\/code> flag, which facilitates easier integration and usage of different module systems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Native WebSocket Client<\/h3>\n\n\n\n<p>Node.js 22 introduces a native WebSocket client that streamlines the implementation of real-time web functionalities. This built-in capability eliminates the dependency on third-party libraries for WebSocket communication, making it easier to develop applications that require live data updates, such as chat apps or live notifications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Updates to the V8 JavaScript Engine<\/h3>\n\n\n\n<p>The V8 JavaScript engine in Node.js 22 has been updated to improve performance and introduce new ECMAScript features, keeping Node.js at the forefront of JavaScript execution efficiency. The updated V8 engine now supports new features such as WebAssembly Garbage Collection, Array.fromAsync, Set methods, and iterator helpers, significantly enhancing performance and capabilities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other Updates<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Enabled Maglev Compiler<\/strong>: Automatically enabled on compatible architectures, the Maglev Compiler enhances the execution efficiency of brief CLI programs, optimizing operations for faster, more responsive performance.<\/li>\n\n\n\n<li><strong>Direct Execution of package.json Scripts<\/strong>: An innovative experimental feature in Node.js 22 is the ability to execute scripts directly from the <code>package.json<\/code> using the CLI flag <code>node --run &lt;script-in-package-json&gt;<\/code>. This feature offers developers a streamlined way to manage and execute scripts, improving workflow efficiency.<\/li>\n\n\n\n<li><strong>Official Stable Watch Mode<\/strong>: The <code>node --watch<\/code> feature, which reloads Node.js processes automatically upon file modifications, has reached full stability. This functionality is crucial for developers seeking efficient iterative testing and development.<\/li>\n\n\n\n<li><strong>Stream Performance Enhancement<\/strong>: The adjustment of the default High Water Mark from 16KiB to 64KiB improves overall performance for streaming operations, albeit at the expense of a modest increase in memory usage.<\/li>\n\n\n\n<li><strong>Introduction of Globbing Capabilities<\/strong>: The <code>glob<\/code> and <code>globSync<\/code> functions have been added to the <code>node:fs<\/code> module, enabling developers to match file paths based on specific patterns easily.<\/li>\n\n\n\n<li><strong>Enhanced Creation of AbortSignal Instances<\/strong>: Improvements in the creation process for <code>AbortSignal<\/code> instances result in significant performance boosts for APIs like <code>fetch<\/code> and various testing tools.<\/li>\n<\/ul>\n\n\n\n<p> To download Node.js 22.0.0 and explore these new capabilities, visit <a href=\"https:\/\/nodejs.org\/en\/download\" target=\"_blank\" rel=\"noreferrer noopener\">Node.js Downloads<\/a>. For more details on the features and the complete list of commits, check out the <a href=\"https:\/\/github.com\/nodejs\/node\/pull\/52505\" target=\"_blank\" rel=\"noreferrer noopener\">Official GitHub<\/a>. <\/p>\n\n\n\n<p>As Node.js 22 progresses from its &#8220;Current&#8221; release status to long-term support (LTS) in October, you have the opportunity to start integrating these innovations into their projects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Node.js Release Schedule<a href=\"https:\/\/github.com\/nodejs\/release#release-schedule\"><\/a><\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Release<\/th><th>Status<\/th><th>Initial Release<\/th><th>Active LTS Start<\/th><th>Maintenance Start<\/th><th>End-of-life<\/th><\/tr><\/thead><tbody><tr><td>18.x<\/td><td><strong>Maintenance<\/strong><\/td><td>April 19, 2022<\/td><td>October 25, 2022<\/td><td>October 18, 2023<\/td><td>April 30, 2025<\/td><\/tr><tr><td>20.x<\/td><td><strong>LTS<\/strong><\/td><td>April 18, 2023<\/td><td>October 24, 2023<\/td><td>October 22, 2024<\/td><td>April 30, 2026<\/td><\/tr><tr><td>21.x<\/td><td><strong><strong>Maintenance<\/strong><\/strong><\/td><td>October 17, 2023<\/td><td>&#8211;<\/td><td>April 1, 2024<\/td><td>June 1, 2024<\/td><\/tr><tr><td>22.x<\/td><td><strong><strong>Current<\/strong><\/strong><\/td><td>April 23, 2024<\/td><td>October 29, 2024<\/td><td>October 21, 2024<\/td><td>April 30, 2027<\/td><\/tr><tr><td>23.x<\/td><td><strong>Pending<\/strong><\/td><td>October 15, 2024<\/td><td>&#8211;<\/td><td>April 1, 2025<\/td><td>June 1, 2025<\/td><\/tr><tr><td>24.x<\/td><td><strong>Pending<\/strong><\/td><td>April 22, 2025<\/td><td>October 28, 2025<\/td><td>October 20, 2026<\/td><td>April 30, 2028<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n<\/div>\n\n\n<div class=\"jumbotron\">\r\n<p>Improve the performance and security of your store with specialized <a href=\"https:\/\/www.inmotionhosting.com\/php-hosting\">PHP Hosting<\/a>. Get faster speeds for your online store with NVMe storage, server protection, dedicated resources, and optimization tools.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>99.99% Uptime    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>Free SSL    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>Dedicated IP Address    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>Managed Server<\/p>\r\n<p><a class=\"btn btn-primary btn-lg\" href=\"https:\/\/www.inmotionhosting.com\/php-hosting\">PHP Hosting<\/a><\/p>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Node.js, the powerful and popular JavaScript runtime, has released its latest version\u2014Node.js 22. In this release, three major updates stand out: the enhanced capability to require() ECMAScript modules (ESM) within CommonJS modules, the introduction of a built-in WebSocket client, and the latest updates to the V8 JavaScript engine. Let&#8217;s explore these updates and more! Main<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/\"> Read More ><\/a><\/p>\n","protected":false},"author":109,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[358],"tags":[],"class_list":["post-76254","post","type-post","status-publish","format-standard","hentry","category-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What\u2019s New in Node.js 22: Exciting Features and Updates | InMotion Hosting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What\u2019s New in Node.js 22: Exciting Features and Updates | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Node.js, the powerful and popular JavaScript runtime, has released its latest version\u2014Node.js 22. In this release, three major updates stand out: the enhanced capability to require() ECMAScript modules (ESM) within CommonJS modules, the introduction of a built-in WebSocket client, and the latest updates to the V8 JavaScript engine. Let&#8217;s explore these updates and more! Main Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-25T21:08:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T11:16:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-1024x538.png\" \/>\n<meta name=\"author\" content=\"Derrell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@inmotionhosting\" \/>\n<meta name=\"twitter:site\" content=\"@inmotionhosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Derrell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What\u2019s New in Node.js 22: Exciting Features and Updates | InMotion Hosting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/","og_locale":"en_US","og_type":"article","og_title":"What\u2019s New in Node.js 22: Exciting Features and Updates | InMotion Hosting","og_description":"Node.js, the powerful and popular JavaScript runtime, has released its latest version\u2014Node.js 22. In this release, three major updates stand out: the enhanced capability to require() ECMAScript modules (ESM) within CommonJS modules, the introduction of a built-in WebSocket client, and the latest updates to the V8 JavaScript engine. Let&#8217;s explore these updates and more! Main Read More >","og_url":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/","og_site_name":"InMotion Hosting Blog","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting","article_published_time":"2024-04-25T21:08:00+00:00","article_modified_time":"2024-04-29T11:16:08+00:00","og_image":[{"url":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-1024x538.png","type":"","width":"","height":""}],"author":"Derrell","twitter_card":"summary_large_image","twitter_creator":"@inmotionhosting","twitter_site":"@inmotionhosting","twitter_misc":{"Written by":"Derrell","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/"},"author":{"name":"Derrell","@id":"https:\/\/www.inmotionhosting.com\/blog\/#\/schema\/person\/5124acb86d7edd60e8a3c502ecab6e6b"},"headline":"What\u2019s New in Node.js 22: Exciting Features and Updates","datePublished":"2024-04-25T21:08:00+00:00","dateModified":"2024-04-29T11:16:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/"},"wordCount":516,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-1024x538.png","articleSection":["Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/","url":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/","name":"What\u2019s New in Node.js 22: Exciting Features and Updates | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release-1024x538.png","datePublished":"2024-04-25T21:08:00+00:00","dateModified":"2024-04-29T11:16:08+00:00","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release.png","contentUrl":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2024\/04\/nodejs22-release.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/blog\/nodejs22-release\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.inmotionhosting.com\/blog\/web-development\/"},{"@type":"ListItem","position":3,"name":"What\u2019s New in Node.js 22: Exciting Features and Updates"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/blog\/#website","url":"https:\/\/www.inmotionhosting.com\/blog\/","name":"InMotion Hosting Blog","description":"Web Hosting Strategy, Trends and Security","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/blog\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2019\/11\/imh-logo-all-colors-big.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/blog\/wp-content\/uploads\/2019\/11\/imh-logo-all-colors-big.jpg","width":1630,"height":430,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting","https:\/\/x.com\/inmotionhosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/blog\/#\/schema\/person\/5124acb86d7edd60e8a3c502ecab6e6b","name":"Derrell","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0f3cb5810f545fb23da70ace1b099415f93c033b339e1c3ab3b29a6e60cf7759?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0f3cb5810f545fb23da70ace1b099415f93c033b339e1c3ab3b29a6e60cf7759?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0f3cb5810f545fb23da70ace1b099415f93c033b339e1c3ab3b29a6e60cf7759?s=96&r=g","caption":"Derrell"},"url":"https:\/\/www.inmotionhosting.com\/blog\/author\/derrellw\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":358,"name":"Web Development","slug":"web-development","link":"https:\/\/www.inmotionhosting.com\/blog\/web-development\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/posts\/76254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=76254"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/posts\/76254\/revisions"}],"predecessor-version":[{"id":76261,"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/posts\/76254\/revisions\/76261"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=76254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=76254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=76254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}