<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andreas Herz</title>
    <description>The latest articles on DEV Community by Andreas Herz (@andreas_herz).</description>
    <link>https://dev.to/andreas_herz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F327728%2F1fe0287f-8e22-425c-823e-8341e74a3f0b.png</url>
      <title>DEV Community: Andreas Herz</title>
      <link>https://dev.to/andreas_herz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andreas_herz"/>
    <language>en</language>
    <item>
      <title>Integrating Git Submodules the Easy Way</title>
      <dc:creator>Andreas Herz</dc:creator>
      <pubDate>Wed, 08 Jul 2026 12:34:59 +0000</pubDate>
      <link>https://dev.to/andreas_herz/integrating-git-submodules-the-easy-way-3ffd</link>
      <guid>https://dev.to/andreas_herz/integrating-git-submodules-the-easy-way-3ffd</guid>
      <description>&lt;p&gt;Git submodules have a reputation for being fiddly, but most of that pain comes down to a handful of missing commands and one config flag nobody mentions. Used well, they're a clean way to embed a shared library, a design-system repo, or a common docs folder inside another project - pinned to an exact commit so nothing shifts under your feet. This guide walks through the whole lifecycle, from adding a submodule to removing it, and calls out the gotchas that bite teams in real projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding What a Submodule Actually Is
&lt;/h2&gt;

&lt;p&gt;Before the commands, one mental model that clears up most confusion: a submodule embeds another git repo inside yours at a fixed path, pinned to a specific commit. Your repo doesn't track the submodule's files - it tracks &lt;em&gt;which commit&lt;/em&gt; of the submodule to check out. That single idea explains almost every quirk that follows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a Submodule
&lt;/h2&gt;

&lt;p&gt;Adding one is a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git submodule add git@github.com:org/shared-lib.git vendor/shared-lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This clones the repo into &lt;code&gt;vendor/shared-lib&lt;/code&gt;, creates a &lt;code&gt;.gitmodules&lt;/code&gt; file describing the mapping, and stages the pinned commit (git calls this a "gitlink"). Commit both pieces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add .gitmodules vendor/shared-lib
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"chore: add shared-lib submodule"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The resulting &lt;code&gt;.gitmodules&lt;/code&gt; entry is plain text and lives in version control:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[submodule "vendor/shared-lib"]&lt;/span&gt;
    &lt;span class="py"&gt;path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;vendor/shared-lib&lt;/span&gt;
    &lt;span class="py"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;git@github.com:org/shared-lib.git&lt;/span&gt;
    &lt;span class="py"&gt;branch&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;branch&lt;/code&gt; line is optional: it's only used later when pulling the latest changes automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloning Without the Empty-Folder Surprise
&lt;/h2&gt;

&lt;p&gt;The most common submodule complaint is a teammate cloning the project and finding an empty folder where the submodule should be. The fix is knowing two commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone everything in one shot&lt;/span&gt;
git clone &lt;span class="nt"&gt;--recurse-submodules&lt;/span&gt; &amp;lt;your-repo-url&amp;gt;

&lt;span class="c"&gt;# Already cloned? Initialize after the fact&lt;/span&gt;
git submodule update &lt;span class="nt"&gt;--init&lt;/span&gt; &lt;span class="nt"&gt;--recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even better, run this once per machine so &lt;code&gt;git pull&lt;/code&gt; and &lt;code&gt;git checkout&lt;/code&gt; keep submodules in sync automatically - after this, submodules mostly disappear from your day-to-day:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; submodule.recurse &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wiring Up Continuous Integration
&lt;/h2&gt;

&lt;p&gt;Here's the step that quietly breaks builds: CI systems do &lt;strong&gt;not&lt;/strong&gt; fetch submodules by default. On GitHub Actions, one line fixes it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;submodules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recursive&lt;/span&gt; &lt;span class="c1"&gt;# or 'true' for a single level&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every CI provider has an equivalent flag, and forgetting it is the number-one reason a project that works locally fails in the pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating to a Newer Commit
&lt;/h2&gt;

&lt;p&gt;Since your repo pins an exact commit, updating is deliberate - nothing moves until you say so. To grab the latest from the submodule's tracked branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git submodule update &lt;span class="nt"&gt;--remote&lt;/span&gt; vendor/shared-lib
git add vendor/shared-lib
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"chore: bump shared-lib submodule"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prefer pinning to a specific tag or commit? Check it out inside the submodule and record the new pin in the parent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;vendor/shared-lib
git fetch &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git checkout v2.1.0
&lt;span class="nb"&gt;cd&lt;/span&gt; -
git add vendor/shared-lib &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"chore: pin shared-lib to v2.1.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Making Changes Inside a Submodule
&lt;/h2&gt;

&lt;p&gt;A submodule is a full git repo, so you can edit it in place. Just remember it starts in a detached HEAD state, so check out a branch first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;vendor/shared-lib
git checkout main
&lt;span class="c"&gt;# edit, commit, and push to the submodule's own remote&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; -
git add vendor/shared-lib &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"chore: bump submodule after change"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The golden rule: always push inside the submodule &lt;em&gt;before&lt;/em&gt; committing the parent. The parent only stores a commit hash, so an unpushed submodule commit leaves everyone else with a broken clone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Removing a Submodule
&lt;/h2&gt;

&lt;p&gt;When a submodule has served its purpose, three commands clean it up completely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git submodule deinit &lt;span class="nt"&gt;-f&lt;/span&gt; vendor/shared-lib
git &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; vendor/shared-lib
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; .git/modules/vendor/shared-lib
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"chore: remove shared-lib submodule"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Gotchas Worth Bookmarking
&lt;/h2&gt;

&lt;p&gt;Most submodule frustration traces back to the same short list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Empty folder after cloning:&lt;/strong&gt; someone forgot &lt;code&gt;--recurse-submodules&lt;/code&gt; or &lt;code&gt;update --init&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI failures:&lt;/strong&gt; the checkout step is missing &lt;code&gt;submodules: recursive&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detached HEAD:&lt;/strong&gt; check out a branch before editing inside a submodule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broken pins for teammates:&lt;/strong&gt; the parent commit was pushed before the submodule commit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Private submodules in CI:&lt;/strong&gt; the pipeline's token or deploy key needs read access to the submodule repo too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Submodules aren't scary once the moving parts click into place: they pin a commit, they need an extra flag to clone and to build, and they reward pushing in the right order. Set &lt;code&gt;submodule.recurse true&lt;/code&gt;, add &lt;code&gt;submodules: recursive&lt;/code&gt; to your CI, and most of the friction disappears. For the full reference, the official &lt;a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules" rel="noopener noreferrer"&gt;Git Submodules documentation&lt;/a&gt; is excellent.&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Exploring the Exciting New Features in Node.js 22</title>
      <dc:creator>Andreas Herz</dc:creator>
      <pubDate>Thu, 02 May 2024 13:59:36 +0000</pubDate>
      <link>https://dev.to/andreas_herz/exploring-the-exciting-new-features-in-nodejs-22-1j90</link>
      <guid>https://dev.to/andreas_herz/exploring-the-exciting-new-features-in-nodejs-22-1j90</guid>
      <description>&lt;p&gt;Node.js 22 has arrived with a host of exciting new features and improvements that aim to enhance the developer experience, streamline workflows, and optimize performance. In this article, we'll dive into some of the most notable additions and how they can benefit your Node.js projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mixing Module Systems with require()ing ESM Graphs
&lt;/h3&gt;

&lt;p&gt;One of the standout features in Node.js 22 is the ability to require ECMAScript modules (ESM) directly within CommonJS modules using the &lt;code&gt;--experimental-require-module&lt;/code&gt; flag. This allows you to seamlessly integrate different module systems in your applications, providing more flexibility in managing dependencies and code organization.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// CommonJS module&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;sayHello&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./esm-module.mjs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Hello from ESM!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Built-in WebSocket Client for Real-Time Communication
&lt;/h3&gt;

&lt;p&gt;Node.js 22 includes a native WebSocket client, eliminating the need for external libraries like the &lt;code&gt;ws&lt;/code&gt; module. This built-in capability simplifies the development of applications that require live data updates, such as chat apps or live notifications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;WebSocket&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;node:ws&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebSocket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ws://example.com/websocket&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WebSocket connection established&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, server!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Leveraging V8 JavaScript Engine Updates
&lt;/h3&gt;

&lt;p&gt;Node.js 22 incorporates updates to the V8 JavaScript engine, bringing features like WebAssembly Garbage Collection, &lt;code&gt;Array.fromAsync&lt;/code&gt;, Set methods, and iterator helpers. These enhancements provide more tools for developers to write efficient and expressive code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromAsync&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// [1, 2, 3]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Streamlining Scripts with Direct Execution of package.json
&lt;/h3&gt;

&lt;p&gt;An experimental feature in Node.js 22 allows you to execute scripts directly from the &lt;code&gt;package.json&lt;/code&gt; file using the &lt;code&gt;node --run &amp;lt;script-in-package-json&amp;gt;&lt;/code&gt; CLI flag. This simplifies script management and execution, improving development workflows and making it easier to run specific tasks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node app.js"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;--run&lt;/span&gt; start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Enhancing Streaming Performance
&lt;/h3&gt;

&lt;p&gt;Node.js 22 adjusts the default High Water Mark from 16KiB to 64KiB, improving overall performance for streaming operations. While this may result in a slight increase in memory usage, it can significantly boost the efficiency of your streaming-based applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;node:fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;readStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createReadStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;large-file.txt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;highWaterMark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 64 KiB&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These new features and improvements in Node.js 22 demonstrate the ongoing efforts to enhance the developer experience, streamline workflows, and optimize performance for various types of applications. As you explore and adopt these features in your projects, you'll be able to write more efficient, expressive, and maintainable code.&lt;/p&gt;

&lt;p&gt;To learn more about Node.js 22 and its capabilities, visit the official Node.js documentation at &lt;a href="https://nodejs.org/docs/latest-v22.x/api/" rel="noopener noreferrer"&gt;https://nodejs.org/docs/latest-v22.x/api/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding with Node.js 22!&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
