<?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: Boudy de Geer</title>
    <description>The latest articles on DEV Community by Boudy de Geer (@boudydegeer).</description>
    <link>https://dev.to/boudydegeer</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F377175%2Fd5b339da-3f5f-47f3-9af8-e1d2b16fa41d.png</url>
      <title>DEV Community: Boudy de Geer</title>
      <link>https://dev.to/boudydegeer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/boudydegeer"/>
    <language>en</language>
    <item>
      <title>My Manifesto Against AI "Ping-Pong" &amp; Token Waste (and the Project Intelligence Platform I'm Building in Public to Fix It)</title>
      <dc:creator>Boudy de Geer</dc:creator>
      <pubDate>Tue, 21 Oct 2025 14:09:43 +0000</pubDate>
      <link>https://dev.to/boudydegeer/my-manifesto-against-ai-ping-pong-token-waste-and-the-project-intelligence-platform-im-186l</link>
      <guid>https://dev.to/boudydegeer/my-manifesto-against-ai-ping-pong-token-waste-and-the-project-intelligence-platform-im-186l</guid>
      <description>&lt;p&gt;&lt;em&gt;I'm tired of burning $100/mo on wasted AI tokens just to build a single feature. So I'm building the solution. This is Day 1.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;Like many of you, I use AI tools like the Claude Code CLI and Gemini CLI daily. They're incredibly powerful, but let's be honest: they're also a massive drain on time and money.&lt;/p&gt;

&lt;p&gt;I found myself trapped in a constant "ping-pong" match. 20+ prompts just to get one simple feature halfway done. Explaining the context over, and over, and over again. And the cost? I was burning over $100 per month just on repeated context tokens – information the AI should already know!&lt;/p&gt;

&lt;p&gt;My side projects were stalling. I have 3 SaaS ideas I know could be real businesses, but with only 2-3 hours a day after my job, spending 80% of that time wrestling with AI context just wasn't sustainable. Six months later? Nothing launched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Real Problem:&lt;/strong&gt; &lt;em&gt;It's Not the AI, It's the Orchestration!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I realized the issue isn't the Large Language Models themselves. They're amazing. The problem is the lack of memory between sessions and, more importantly, the lack of intelligent orchestration. We're getting "vibe coding" at light speed – fast prototypes, faster tech debt, and ultimately, chaos.&lt;/p&gt;

&lt;p&gt;Copilot only autocompletes. ChatGPT requires endless copy-pasting. Even powerful CLIs lack project-level intelligence.&lt;/p&gt;

&lt;p&gt;The Solution: Building the Co-Founder I Always Wanted&lt;br&gt;
So, I stopped complaining and started building: MOSAIQO.&lt;/p&gt;

&lt;p&gt;MOSAIQO isn't just another AI assistant. It's a Project Intelligence Platform designed to sit on top of tools like Claude and Gemini.&lt;/p&gt;

&lt;p&gt;What does it do differently? It EXECUTES.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Imagine this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You (at a cafe):&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I want to add Stripe payments."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;MOSAIQO:&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✓ Analyzes your codebase.&lt;br&gt;
✓ Uses AI Planning to generate the necessary tasks (e.g., 12 steps).&lt;br&gt;
✓ Uses smart RAG to feed ONLY the relevant context for EACH task (saving ~95% tokens).&lt;br&gt;
✓ Orchestrates agents (Claude/Gemini) using your API keys to implement the code.&lt;br&gt;
✓ Enforces TDD and quality gates.&lt;br&gt;
✓ Updates your documentation hub.&lt;br&gt;
✓ Creates a Pull Request.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;You (30 minutes later):&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Review and approve.&lt;br&gt;
Result: 3 hours &amp;amp; $8 in tokens → 30 mins &amp;amp; $0.40 in tokens.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;The 3 Unique Game-Changers:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MOSAIQO is built around three core pillars nobody else is combining effectively:&lt;/p&gt;

&lt;p&gt;Remote + Multi-Workers: Install lightweight "worker" apps on your home Mac, a cheap VPS, anywhere. Assign tasks from your laptop, and your distributed team of AI agents executes them in parallel, 24/7, using hardware you already own. Work from anywhere, build anytime, without burning your laptop or cloud credits.&lt;/p&gt;

&lt;p&gt;Full Lifecycle (Idea → Production): From brainstorming and refining your initial idea with AI Planning, to generating a full project roadmap, orchestrating the implementation, and even...&lt;/p&gt;

&lt;p&gt;Auto-Fix Production Bugs: Connect MOSAIQO to Sentry (or similar). When a bug hits at 3 AM, MOSAIQO automatically analyzes it, writes the fix, implements the test, creates the PR, and notifies you. You wake up, review, merge, deploy. Hours of debugging → 5 minutes.&lt;/p&gt;

&lt;p&gt;This Isn't Just a Tool, It's a Rebellion&lt;br&gt;
MOSAIQO is my manifesto against "vibe coding," wasted tokens, and ideas dying in notebooks. It's built for developers with side projects, non-technical entrepreneurs, and small startups who need to move fast without sacrificing quality.&lt;/p&gt;

&lt;p&gt;And because you run the workers and can bring your own API keys (BYOK), the margins are insane, allowing for affordable pricing ($12-$59/mo for early birds) with a ridiculous ROI for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Join the Journey (Build in Public)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yesterday, I launched the official countdown on mosaiqo.dev. It's more than a clock; it's my public promise to build the core MVP over the next two weeks, sharing the code, the bugs, and the breakthroughs along the way.&lt;/p&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/zRgwdRcXGvU"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;The waitlist for the first pioneers opens on November 3rd.&lt;/p&gt;

&lt;p&gt;This is Day 1. This is the rebellion.&lt;/p&gt;

&lt;p&gt;If you're tired of the AI "ping-pong" and burning money on tokens, if you believe there's a better way to build with AI... join me.&lt;/p&gt;

&lt;p&gt;Follow the daily journey on Twitter: &lt;a href="https://x.com/boudydegeer" rel="noopener noreferrer"&gt;@boudydegeer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Join the countdown at: &lt;a href="https://mosaiqo.dev" rel="noopener noreferrer"&gt;mosaiqo.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love your honest feedback on this vision. Are you feeling this pain too? What are your thoughts? Let me know in the comments!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Authentication in Nuxt3 with Sidebase Nuxt-Auth</title>
      <dc:creator>Boudy de Geer</dc:creator>
      <pubDate>Tue, 13 Feb 2024 09:12:33 +0000</pubDate>
      <link>https://dev.to/boudydegeer/authentication-in-nuxt3-with-sidebase-nuxt-auth-38bk</link>
      <guid>https://dev.to/boudydegeer/authentication-in-nuxt3-with-sidebase-nuxt-auth-38bk</guid>
      <description>&lt;p&gt;This tutorial aims to simplify the process of adding robust authentication mechanisms, whether you're looking to implement social logins, email verification, or traditional username and password authentication.&lt;/p&gt;

&lt;p&gt;This is the official GitHub, go ahead and give them some love by ⭐️ it.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://github.com/sidebase" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F112630501%3Fs%3D280%26v%3D4" height="280" class="m-0" width="280"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://github.com/sidebase" rel="noopener noreferrer" class="c-link"&gt;
            sidebase · GitHub
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            High quality open-source software to kick-start your development - sidebase
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.githubassets.com%2Ffavicons%2Ffavicon.svg" width="32" height="32"&gt;
          github.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Introduction to Sidebase Nuxt-Auth
&lt;/h2&gt;

&lt;p&gt;Sidebase Nuxt-Auth is a powerful authentication module tailored for Nuxt3 applications. It facilitates the integration of diverse authentication methods, making your application secure and accessible.&lt;br&gt;
&lt;a href="https://sidebase.io/nuxt-auth/" rel="noopener noreferrer"&gt;Here you can find the documentation&lt;/a&gt; thanks to &lt;a class="mentioned-user" href="https://dev.to/danielroe"&gt;@danielroe&lt;/a&gt; and &lt;a href="https://github.com/sidebase/nuxt-auth/graphs/contributors" rel="noopener noreferrer"&gt;all other devs&lt;/a&gt; that maintain and contribute to the project&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting Your Project Ready
&lt;/h2&gt;

&lt;p&gt;Before diving into the authentication setup, make sure you have a Nuxt3 application up and running. If you're just starting, here's how to create a new Nuxt3 project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx nuxi init nuxt3-app
&lt;span class="nb"&gt;cd &lt;/span&gt;nuxt3-app
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, add the necessary authentication packages to your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @next-auth/prisma-adapter next-auth @prisma/client bcrypt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuring Sidebase Nuxt-Auth
&lt;/h2&gt;

&lt;p&gt;The core of setting up Sidebase Nuxt-Auth lies in its configuration. &lt;/p&gt;

&lt;p&gt;Let's break it down:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Authentication Handler Setup
&lt;/h3&gt;

&lt;p&gt;Initialize the NuxtAuthHandler with your secret and session strategy:&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NuxtAuthHandler&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nc"&gt;NuxtAuthHandler&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A_Strong_Secret&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;session&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jwt&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;
  
  
  Step 2: Adding Authentication Providers
&lt;/h3&gt;

&lt;p&gt;Sidebase Nuxt-Auth supports various providers. Here's how to add some common ones:&lt;/p&gt;

&lt;p&gt;Email Provider:&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="nc"&gt;EmailProvider&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;EMAIL_SERVER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;EMAIL_FROM&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;p&gt;Social Providers (e.g., GitHub, Google):&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="nc"&gt;GithubProvider&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GITHUB_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GITHUB_CLIENT_SECRET&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;
  
  
  Step 3: Customizing Authentication Pages and Callbacks
&lt;/h3&gt;

&lt;p&gt;Specify custom routes for authentication actions in your configuration:&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="nx"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/auth/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;signOut&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/auth/logout&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;p&gt;Use callbacks for additional control over the authentication flow:&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="nx"&gt;callbacks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Custom logic here&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&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;
  
  
  Securely Storing Secrets
&lt;/h3&gt;

&lt;p&gt;Remember to use environment variables for storing sensitive information like client secrets, avoiding hard-coded values in your source code.&lt;/p&gt;

&lt;p&gt;Implementing User Registration&lt;br&gt;
A crucial part of managing user authentication is allowing users to register. Here's a basic overview:&lt;/p&gt;

&lt;p&gt;Define an Event Handler:&lt;/p&gt;

&lt;p&gt;Start by creating an event handler that processes registration requests:&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hash&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bcrypt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineEventHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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="c1"&gt;// Registration logic here&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read and Validate User Input:&lt;/p&gt;

&lt;p&gt;Ensure the provided information is valid and the user doesn't already exist:&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;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readBody&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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;userExists&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cm"&gt;/* logic to check if user exists */&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userExists&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Handle existing user case&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Store User Credentials Securely:&lt;/p&gt;

&lt;p&gt;Hash the user's password and store the new user in the database:&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;hashedPassword&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Logic to create user record&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Integrating Sidebase Nuxt-Auth enhances your Nuxt3 project's security and user experience by offering a streamlined authentication system. By following the steps outlined, you can set up a versatile authentication system that caters to a wide range of use cases.&lt;/p&gt;

&lt;p&gt;Remember, the effectiveness of your authentication system not only lies in its setup but also in regular maintenance and adherence to security best practices. &lt;/p&gt;

&lt;p&gt;Thanks 👋 for reading and supporting!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nuxt</category>
      <category>authentication</category>
      <category>vue</category>
    </item>
    <item>
      <title>Getting Started with Nuxt 3</title>
      <dc:creator>Boudy de Geer</dc:creator>
      <pubDate>Fri, 09 Feb 2024 10:28:37 +0000</pubDate>
      <link>https://dev.to/boudydegeer/getting-started-with-nuxt-3-5h11</link>
      <guid>https://dev.to/boudydegeer/getting-started-with-nuxt-3-5h11</guid>
      <description>&lt;p&gt;Hey there! If you're curious about building web apps that shine, you're in the right spot. Nuxt 3 is here to transform your ideas into reality, no matter your experience level. It's the newest family member of the Vue.js universe, crafted to streamline your development process from start to finish. So, whether you're just starting your coding adventure or you're a seasoned pro eager to explore what Nuxt 3 has in store, this guide is your companion. Together, we'll have a look at the features that make Nuxt 3 a game-changer. &lt;/p&gt;

&lt;p&gt;First let me thank &lt;a class="mentioned-user" href="https://dev.to/atinux"&gt;@atinux&lt;/a&gt;,&lt;a class="mentioned-user" href="https://dev.to/danielroe"&gt;@danielroe&lt;/a&gt;, &lt;a class="mentioned-user" href="https://dev.to/pi0"&gt;@pi0&lt;/a&gt;, and &lt;a href="https://github.com/nuxt/nuxt/graphs/contributors" rel="noopener noreferrer"&gt;all +630 &lt;br&gt;
 contributors and maintainers (at the time of this writing)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the official GitHub, go ahead and give them some love by ⭐️ it.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/nuxt" rel="noopener noreferrer"&gt;
        nuxt
      &lt;/a&gt; / &lt;a href="https://github.com/nuxt/nuxt" rel="noopener noreferrer"&gt;
        nuxt
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The Intuitive Vue Framework.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://nuxt.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fnuxt%2Fnuxt%2F.%2F.github%2Fassets%2Fbanner.svg" alt="Nuxt banner"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Nuxt&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
  &lt;a href="https://www.npmjs.com/package/nuxt" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/3fe28fe0c608e0508b4c02d8482dc044012fbc579cbc2e67fc3775f23bb0bb50/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f6e7578742e7376673f7374796c653d666c617426636f6c6f72413d31383138314226636f6c6f72423d323843463844" alt="Version"&gt;&lt;/a&gt;
  &lt;a href="https://www.npmjs.com/package/nuxt" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/280714477b8c9aa2b4115dfd75dfed6d7fdc02b6572777330d4a8f7eaa2f6588/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f6e7578742e7376673f7374796c653d666c617426636f6c6f72413d31383138314226636f6c6f72423d323843463844" alt="Downloads"&gt;&lt;/a&gt;
  &lt;a href="https://github.com/nuxt/nuxt/tree/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7efafc47d9b68493cf49070180f7faaf60560eae8b7d6f31ce0e99f4e4a58c29/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e7578742f6e7578742e7376673f7374796c653d666c617426636f6c6f72413d31383138314226636f6c6f72423d323843463844" alt="License"&gt;&lt;/a&gt;
  &lt;a href="https://nuxt.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f074f2a5f2178530567e80636abdc868f793616c0513090f9a3c26c5e1b23df3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e757874253230446f63732d3138313831423f6c6f676f3d6e757874" alt="Website"&gt;&lt;/a&gt;
  &lt;a href="https://chat.nuxt.dev" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/69e5583eb5a39535e58a63c74f2c9808bcc6a803cc938bcf71136f38ccf90da9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e757874253230446973636f72642d3138313831423f6c6f676f3d646973636f7264" alt="Discord"&gt;&lt;/a&gt;
  &lt;a href="https://securityscorecards.dev/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f585593d1e78f20621a7c594a2ad3220677bef813621d1c39149cdedec30597a/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f6e7578742f6e7578742f6261646765" alt="Nuxt openssf scorecard score"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.&lt;/p&gt;

&lt;p&gt;It provides a number of features that make it easy to build fast, SEO-friendly, and scalable web applications, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server-side rendering, Static Site Generation, Hybrid Rendering and Edge-Side Rendering&lt;/li&gt;
&lt;li&gt;Automatic routing with code-splitting and pre-fetching&lt;/li&gt;
&lt;li&gt;Data fetching and state management&lt;/li&gt;
&lt;li&gt;SEO Optimization and Meta tags definition&lt;/li&gt;
&lt;li&gt;Auto imports of components, composables and utils&lt;/li&gt;
&lt;li&gt;TypeScript with zero configuration&lt;/li&gt;
&lt;li&gt;Go fullstack with our server/ directory&lt;/li&gt;
&lt;li&gt;Extensible with &lt;a href="https://nuxt.com/modules" rel="nofollow noopener noreferrer"&gt;200+ modules&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Deployment to a variety of &lt;a href="https://nuxt.com/deploy" rel="nofollow noopener noreferrer"&gt;hosting platforms&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;...&lt;a href="https://nuxt.com" rel="nofollow noopener noreferrer"&gt;and much more&lt;/a&gt; 🚀&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Table of Contents&lt;/h3&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;a href="https://github.com/nuxt/nuxt#getting-started" rel="noopener noreferrer"&gt;Getting Started&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;a href="https://github.com/nuxt/nuxt#vue-development" rel="noopener noreferrer"&gt; Vue Development&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📖 &lt;a href="https://github.com/nuxt/nuxt#documentation" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧩 &lt;a href="https://github.com/nuxt/nuxt#modules" rel="noopener noreferrer"&gt;Modules&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;❤️  &lt;a href="https://github.com/nuxt/nuxt#contribute" rel="noopener noreferrer"&gt;Contribute&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🏠 &lt;a href="https://github.com/nuxt/nuxt#local-development" rel="noopener noreferrer"&gt;Local Development&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🛟 &lt;a href="https://github.com/nuxt/nuxt#professional-support" rel="noopener noreferrer"&gt;Professional Support&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔗 &lt;a href="https://github.com/nuxt/nuxt#follow-us" rel="noopener noreferrer"&gt;Follow Us&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⚖️ &lt;a href="https://github.com/nuxt/nuxt#license" rel="noopener noreferrer"&gt;License&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/nuxt/nuxt/" rel="noopener noreferrer"&gt;🚀 Getting Started&lt;/a&gt;&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;Use the following command to create a new starter project. This will create a starter…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/nuxt/nuxt" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Ready to get started? &lt;/p&gt;

&lt;p&gt;Great! Let's dive in 🤿.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Nuxt 3?
&lt;/h2&gt;

&lt;p&gt;Nuxt 3 is a progressive Vue.js framework used for building modern web applications. It provides an out-of-the-box setup for server-side rendering, static site generation, and single-page applications, making it incredibly versatile for developers. With Nuxt 3, you can enjoy the benefits of Vue.js, such as its reactive components, and enhance your development experience with Nuxt's powerful features and plugins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Your First Nuxt 3 Project
&lt;/h2&gt;

&lt;p&gt;Getting started with Nuxt 3 is straightforward. Follow these steps, and you'll have your first Nuxt 3 project up and running in no time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before we begin, ensure you have Node.js (version 14 or later) installed on your computer. You can check your current Node.js version by running node -v in your terminal. If you need to install or update Node.js, visit Node.js official website for download instructions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a Nuxt 3 Project
&lt;/h3&gt;

&lt;p&gt;Open your terminal and run the following command to create a new Nuxt 3 project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
npx nuxi init nuxt3-app

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a new directory named nuxt3-app with the initial Nuxt 3 project structure. Feel free to replace nuxt3-app with your preferred project name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Navigate to Your Project Directory
&lt;/h3&gt;

&lt;p&gt;Change into your newly created project directory with:&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;nuxt3-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Install Dependencies
&lt;/h3&gt;

&lt;p&gt;Now, install the project dependencies by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command reads the package.json file in your project directory and installs the necessary packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Run Your Nuxt 3 Project
&lt;/h3&gt;

&lt;p&gt;With the dependencies installed, you're ready to launch your Nuxt 3 application. Start the development server with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
npm run dev

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts a local server. Once it's running, open your web browser and navigate to &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; to see your Nuxt 3 application in action.&lt;/p&gt;

&lt;p&gt;Congratulations 🎉! &lt;br&gt;
&lt;strong&gt;You've successfully set up and run your first Nuxt 3 project.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring Nuxt 3 Features
&lt;/h2&gt;

&lt;p&gt;Nuxt 3 comes packed with features that make web development seamless and efficient. Here are a few key features to explore:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File-based Routing&lt;/strong&gt;: &lt;br&gt;
Nuxt 3 automatically generates routes for your application based on the Vue files in the pages directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fast Hot Module Replacement (HMR)&lt;/strong&gt;: &lt;br&gt;
Enjoy instant feedback on your changes during development without full page reloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Composition API&lt;/strong&gt;: &lt;br&gt;
Utilize Vue 3's Composition API in your Nuxt 3 projects for better code organization and reuse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server-Side Rendering (SSR) and Static Site Generation (SSG)&lt;/strong&gt;: &lt;br&gt;
Easily create pre-rendered pages or static websites for improved performance and SEO.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;Now that you have your Nuxt 3 project running, the possibilities are endless. Here are some suggestions for what to do next:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explore the Documentation&lt;/strong&gt;: &lt;br&gt;
Visit the &lt;a href="https://nuxt.com/docs" rel="noopener noreferrer"&gt;official Nuxt 3 documentation&lt;/a&gt; to deepen your understanding of its features and capabilities.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment with Components&lt;/strong&gt;: &lt;br&gt;
Start creating Vue components in the components directory and use them in your pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn About Nuxt Modules&lt;/strong&gt;:&lt;br&gt;
 Nuxt modules extend your project's functionality. Check out modules like @nuxtjs/axios for making HTTP requests or @nuxtjs/auth-next for authentication.&lt;/p&gt;

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

&lt;p&gt;Nuxt 3 simplifies Vue.js development by providing a robust framework packed with features to enhance your productivity and the performance of your applications. By following this guide, you've taken your first steps into the world of Nuxt 3. Continue experimenting, building, and learning as you unlock the full potential of this powerful framework.&lt;/p&gt;

&lt;p&gt;Thanks 👋 for reading and supporting! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nuxt</category>
      <category>vue</category>
    </item>
    <item>
      <title>Mastering Node.js CLI: Best Practices and Tips</title>
      <dc:creator>Boudy de Geer</dc:creator>
      <pubDate>Tue, 06 Feb 2024 08:39:26 +0000</pubDate>
      <link>https://dev.to/boudydegeer/mastering-nodejs-cli-best-practices-and-tips-7j5</link>
      <guid>https://dev.to/boudydegeer/mastering-nodejs-cli-best-practices-and-tips-7j5</guid>
      <description>&lt;p&gt;This article is inspired by &lt;a href="https://github.com/lirantal/nodejs-cli-apps-best-practices" rel="noopener noreferrer"&gt;this awesome GitHub repository&lt;/a&gt; created by &lt;a class="mentioned-user" href="https://dev.to/lirantal"&gt;@lirantal&lt;/a&gt;, please go ahead and have a look it's worth. &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/lirantal" rel="noopener noreferrer"&gt;
        lirantal
      &lt;/a&gt; / &lt;a href="https://github.com/lirantal/nodejs-cli-apps-best-practices" rel="noopener noreferrer"&gt;
        nodejs-cli-apps-best-practices
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The largest Node.js CLI Apps best practices list ✨
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;
  &lt;p&gt;
    &lt;a href="https://nodejs-security.com" rel="nofollow noopener noreferrer"&gt;
      &lt;img alt="Node.js Security" src="https://camo.githubusercontent.com/2cb9ca41347846ecf91aa44495fed4f781d032590289b0d6324d971e2ff7edbe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462541362538342d4c6561726e2532304e6f64652e6a7325323053656375726974792545322538362539322d677261792e7376673f636f6c6f72413d35373334463526636f6c6f72423d353733344635267374796c653d666c6174"&gt;
    &lt;/a&gt;
  &lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://private-user-images.githubusercontent.com/316371/366997111-970a97fd-16bd-4b3c-b535-ae7445b52d4c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjEwNTY3MDYsIm5iZiI6MTc2MTA1NjQwNiwicGF0aCI6Ii8zMTYzNzEvMzY2OTk3MTExLTk3MGE5N2ZkLTE2YmQtNGIzYy1iNTM1LWFlNzQ0NWI1MmQ0Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMDIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTAyMVQxNDIwMDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZmQxMTBkYmEzMWZmYjAyYmM1YWJhM2FmYmEwNDZmZDA3ZjUyMzg3Y2Q4YjI1MDRlMzEyNzc3YTgyMTcxYzBiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.unMVIltHRp6HqfmPpOy-LztBLG_MMN9gCdvFQvKG4Ys"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fprivate-user-images.githubusercontent.com%2F316371%2F366997111-970a97fd-16bd-4b3c-b535-ae7445b52d4c.png%3Fjwt%3DeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjEwNTY3MDYsIm5iZiI6MTc2MTA1NjQwNiwicGF0aCI6Ii8zMTYzNzEvMzY2OTk3MTExLTk3MGE5N2ZkLTE2YmQtNGIzYy1iNTM1LWFlNzQ0NWI1MmQ0Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMDIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTAyMVQxNDIwMDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZmQxMTBkYmEzMWZmYjAyYmM1YWJhM2FmYmEwNDZmZDA3ZjUyMzg3Y2Q4YjI1MDRlMzEyNzc3YTgyMTcxYzBiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.unMVIltHRp6HqfmPpOy-LztBLG_MMN9gCdvFQvKG4Ys" alt="Screenshot 2024-09-12 at 20 08 07"&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;
    Learn Node.js Secure Coding techniques and best practices from &lt;a href="https://www.lirantal.com" rel="nofollow noopener noreferrer"&gt;Liran Tal&lt;/a&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;br&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Node.js CLI Apps Best Practices&lt;/h1&gt;
&lt;/div&gt;
A collection of curated best practices on how to build successful, empathic and user-friendly Node.js Command Line Interface (CLI) applications
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Why this guide?&lt;/h3&gt;
&lt;/div&gt;
&lt;p&gt;A bad CLI can easily discourage users from interacting with it. Building successful CLIs requires attention to detail and empathy for the user in order to create a good user experience. It is very easy to get wrong.&lt;/p&gt;
&lt;p&gt;In this guide I have compiled a list of best practices across areas of focus which aim to optimize for an ideal user experience when interacting with a CLI application.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Features:&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;✅ 37 best practices for building successful Node.js CLI applications&lt;/li&gt;
&lt;li&gt;✅ Read in a different language: &lt;a href="https://github.com/lirantal/nodejs-cli-apps-best-practices/./README_zh-Hans.md" rel="noopener noreferrer"&gt;🇨🇳&lt;/a&gt;, &lt;a href="https://github.com/lirantal/nodejs-cli-apps-best-practices/./README_es.md" rel="noopener noreferrer"&gt;🇪🇸&lt;/a&gt;, or &lt;a href="https://crowdin.com/project/nodejs-cli-apps-best-practices" rel="nofollow noopener noreferrer"&gt;help translate&lt;/a&gt; to other languages. &lt;a href="https://crowdin.com/project/nodejs-cli-apps-best-practices/discussions" rel="nofollow noopener noreferrer"&gt;Suggest new languages&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;🙏 Contributions are welcome&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;a href="http://creativecommons.org/licenses/by-sa/4.0/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8efd34f273c8ab60589de66dcbd80d0707691394366df4fc74b953456081bbd9/68747470733a2f2f62616467656e2e6e65742f62616467652f4c6963656e73652f43432042592d534120342e302f677265656e"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/9c954e58ecf678fe718f4289e2ee5526e8a0938013ecba855430a8d9b4dd6fde/68747470733a2f2f62616467656e2e6e65742f62616467652f4c6173742532305570646174652f4a616e253230323032342f677265656e"&gt;&lt;img src="https://camo.githubusercontent.com/9c954e58ecf678fe718f4289e2ee5526e8a0938013ecba855430a8d9b4dd6fde/68747470733a2f2f62616467656e2e6e65742f62616467652f4c6173742532305570646174652f4a616e253230323032342f677265656e"&gt;&lt;/a&gt;
&lt;a href="https://www.github.com/lirantal/nodejs-cli-apps-best-practices" rel="noopener noreferrer"&gt;
  &lt;img src="https://camo.githubusercontent.com/096618884ccedb5b095418e6ddb45f9a114f3199e2af6659ad659ba33df6c959/68747470733a2f2f62616467656e2e6e65742f62616467652f4e6f64652e6a7320434c4920417070732f42657374205072616374696365732f707572706c65" alt="Node.js CLI Apps Best Practices"&gt;
&lt;/a&gt;
&lt;a href="https://crowdin.com/project/nodejs-cli-apps-best-practices" rel="nofollow noopener noreferrer"&gt;
  &lt;img src="https://camo.githubusercontent.com/3a2455a3436eb02477403c91e175cbe075e33fcf30e4f3923fbb5ae893fa963d/68747470733a2f2f6261646765732e63726f7764696e2e6e65742f6e6f64656a732d636c692d617070732d626573742d7072616374696365732f6c6f63616c697a65642e737667"&gt;
&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Why me?&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;Hi there, I'm &lt;a href="https://twitter.com/liran_tal" rel="nofollow noopener noreferrer"&gt;Liran Tal&lt;/a&gt; and…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/lirantal/nodejs-cli-apps-best-practices" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Creating a command-line interface (CLI) in Node.js goes beyond basic functionality; it's about offering an intuitive, efficient, and user-friendly experience. Let’s explore the best practices to enhance your Node.js CLI applications, complete with examples to guide you along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Respecting POSIX Arguments
&lt;/h2&gt;

&lt;p&gt;POSIX-compliant argument syntax ensures your CLI aligns with familiar standards, reducing the learning curve for users.&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;// Using yargs for POSIX-compliant arguments parsing&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;yargs&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;yargs/yargs&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;argv&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;yargs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;verbose&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;alias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;v&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;boolean&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Run with verbose logging&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code snippet uses &lt;a href="https://github.com/yargs/yargs" rel="noopener noreferrer"&gt;yargs&lt;/a&gt;, a Node.js package, to parse command-line arguments in a POSIX-compliant way, including support for short and long-form options. You could also use the popular &lt;a href="https://github.com/tj/commander.js#readme" rel="noopener noreferrer"&gt;commander&lt;/a&gt; defined as a complete node.js command-line interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Building Empathic CLIs
&lt;/h2&gt;

&lt;p&gt;An empathic CLI anticipates user errors and guides them towards correct usage, enhancing user experience.&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;// Simple check for required arguments&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&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="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="s2"&gt;Please provide the required argument.&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;p&gt;This example demonstrates basic input validation, ensuring users are prompted for necessary arguments.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Stateful Data Management
&lt;/h2&gt;

&lt;p&gt;Remembering user preferences between sessions makes your CLI more intuitive and user-friendly.&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;// Using configstore for managing stateful data&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Configstore&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;configstore&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;config&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;Configstore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-cli-app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Saving a user preference&lt;/span&gt;
&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Retrieving the saved preference&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.npmjs.com/package/configstore" rel="noopener noreferrer"&gt;Configstore&lt;/a&gt; is an excellent tool for handling persistent data across user sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A Colorful CLI Experience
&lt;/h2&gt;

&lt;p&gt;Colors can make your CLI more engaging and easier to navigate, but always provide options for colorless output.&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;// Using chalk for colored output&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chalk&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;chalk&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;chalk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is a message in blue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.npmjs.com/package/chalk" rel="noopener noreferrer"&gt;Chalk&lt;/a&gt; is a popular choice for adding colors to CLI output while maintaining readability.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Enhancing Interactivity
&lt;/h2&gt;

&lt;p&gt;Rich interactions like dropdowns or progress bars can significantly improve user experience.&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;// Using inquirer for interactive prompts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;inquirer&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;inquirer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;inquirer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;script&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Which setup script do you want to run?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Install&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Configure&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Update&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="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;answers&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="s2"&gt;`Running &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;answers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; script...`&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;p&gt;&lt;a href="https://www.npmjs.com/package/inquirer" rel="noopener noreferrer"&gt;Inquirer.js&lt;/a&gt; is a handy tool for adding interactive prompts to your CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Utilizing Hyperlinks
&lt;/h2&gt;

&lt;p&gt;Embedding hyperlinks in your CLI's output can provide users with quick access to resources and documentation.&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;// Printing a clickable URL in the terminal&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;Visit our documentation: https://docs.example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most modern terminals will automatically detect and make URLs clickable.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Zero Configuration for Initial Setup
&lt;/h2&gt;

&lt;p&gt;A CLI that requires minimal setup enhances user satisfaction by reducing initial friction.&lt;/p&gt;

&lt;p&gt;Detecting environment variables can be a part of zero-configuration design. No specific code example here, but the idea is to use existing system settings or sensible defaults whenever possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Respecting POSIX Signals
&lt;/h2&gt;

&lt;p&gt;Proper handling of POSIX signals like SIGINT ensures your CLI terminates gracefully and behaves predictably.&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;// Graceful shutdown on SIGINT (Ctrl+C)&lt;/span&gt;
&lt;span class="nx"&gt;process&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;SIGINT&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;Process interrupted. Exiting gracefully.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&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="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Handling SIGINT allows your CLI to clean up resources or save state before exiting.&lt;/p&gt;




&lt;p&gt;Developing a Node.js CLI isn't just about getting the job done; it's about crafting an experience that users find intuitive and delightful. By following these best practices, from respecting POSIX standards to handling stateful data and enhancing interactivity, you can create a CLI that not only performs well but also resonates with its users. Remember, the key to a great CLI is a balance between functionality, usability, and a touch of creativity!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>cli</category>
      <category>node</category>
      <category>tips</category>
    </item>
  </channel>
</rss>
