<?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>Forem: johnretsas</title>
    <description>The latest articles on Forem by johnretsas (@johnretsas).</description>
    <link>https://forem.com/johnretsas</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%2F792038%2F67f05282-36ef-4ed8-addc-17508bcf9e54.jpeg</url>
      <title>Forem: johnretsas</title>
      <link>https://forem.com/johnretsas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/johnretsas"/>
    <language>en</language>
    <item>
      <title>NPM package - find-circular</title>
      <dc:creator>johnretsas</dc:creator>
      <pubDate>Wed, 09 Apr 2025 09:51:22 +0000</pubDate>
      <link>https://forem.com/johnretsas/npm-package-find-circular-23jn</link>
      <guid>https://forem.com/johnretsas/npm-package-find-circular-23jn</guid>
      <description>&lt;h2&gt;
  
  
  Detecting Circular References in JavaScript Objects with &lt;code&gt;find-circular&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When working with JavaScript objects, dealing with circular references can be a tricky and frustrating challenge. Circular references occur when an object references itself directly or indirectly, leading to infinite loops or errors when trying to serialize the object with &lt;code&gt;JSON.stringify&lt;/code&gt;. Fortunately, the &lt;code&gt;find-circular&lt;/code&gt; npm package offers a simple and effective way to detect and handle circular references in objects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/johnretsas/find-circular" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/find-circular" rel="noopener noreferrer"&gt;NPM Package&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Circular References Matter
&lt;/h2&gt;

&lt;p&gt;Circular references can cause issues when you attempt to serialize objects into JSON, a common operation in web development. For example:&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;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;a&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="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Throws a TypeError: Converting circular structure to JSON&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The error above happens because &lt;code&gt;JSON.stringify&lt;/code&gt; doesn't know how to handle the circular reference (&lt;code&gt;obj.self&lt;/code&gt; pointing back to &lt;code&gt;obj&lt;/code&gt;). This is where &lt;code&gt;find-circular&lt;/code&gt; shines – it identifies these circular references and replaces them with a placeholder (&lt;code&gt;"[Circular]"&lt;/code&gt;), preventing errors and making the object safe for serialization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing &lt;code&gt;find-circular&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;find-circular&lt;/code&gt; is a lightweight utility designed to detect and handle circular references in JavaScript objects. It’s easy to install and use, making it a go-to solution for debugging or cleaning objects with potential circular references.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;To get started, install the package using npm:&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;find-circular
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to Use &lt;code&gt;find-circular&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here’s a quick example to demonstrate how &lt;code&gt;find-circular&lt;/code&gt; works:&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;findCircular&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="s2"&gt;find-circular&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Create an object with a circular reference&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;a&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="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Detect and handle the circular reference&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="nf"&gt;findCircular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// Output: { a: 1, self: "[Circular]" }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What’s Happening Here?
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;findCircular&lt;/code&gt; function traverses the object and detects any references that point back to an earlier object in the traversal chain. When it finds a circular reference, it replaces it with the string &lt;code&gt;"[Circular]"&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases for &lt;code&gt;find-circular&lt;/code&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Debugging Complex Data Structures
&lt;/h3&gt;

&lt;p&gt;When dealing with deeply nested or dynamic objects, &lt;code&gt;find-circular&lt;/code&gt; helps uncover circular references that might otherwise go unnoticed.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Safe Serialization
&lt;/h3&gt;

&lt;p&gt;If you need to serialize objects for APIs, logging, or storage, &lt;code&gt;find-circular&lt;/code&gt; ensures circular references won’t cause your application to crash.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Object Inspection
&lt;/h3&gt;

&lt;p&gt;Developers can use &lt;code&gt;find-circular&lt;/code&gt; to inspect objects safely in debugging tools or during runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source Code and Contributions
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;find-circular&lt;/code&gt; package is open-source and welcomes contributions! You can explore the source code or raise issues on the [GitHub repository]. Whether you’re looking to add new features, report bugs, or improve documentation, your input is valued.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use &lt;code&gt;find-circular&lt;/code&gt;?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity:&lt;/strong&gt; A lightweight utility that gets the job done with minimal setup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability:&lt;/strong&gt; Handles circular references gracefully, ensuring your objects remain usable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Source:&lt;/strong&gt; Actively maintained with opportunities to contribute and collaborate.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Managing circular references doesn’t have to be a headache. With &lt;code&gt;find-circular&lt;/code&gt;, you can quickly identify and handle problematic references, making your objects safe for serialization and inspection. Give it a try in your next project and simplify how you handle complex JavaScript objects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/johnretsas/find-circular" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/find-circular" rel="noopener noreferrer"&gt;NPM Package&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>typescript</category>
      <category>api</category>
    </item>
    <item>
      <title>Getting Started with a Node.js TypeScript Boilerplate</title>
      <dc:creator>johnretsas</dc:creator>
      <pubDate>Mon, 09 Dec 2024 09:12:53 +0000</pubDate>
      <link>https://forem.com/johnretsas/getting-started-with-a-nodejs-typescript-boilerplate-53p5</link>
      <guid>https://forem.com/johnretsas/getting-started-with-a-nodejs-typescript-boilerplate-53p5</guid>
      <description>&lt;h2&gt;
  
  
  Getting Started with a Node.js TypeScript Boilerplate using esbuild
&lt;/h2&gt;

&lt;p&gt;Setting up a modern Node.js project with &lt;strong&gt;TypeScript&lt;/strong&gt;, &lt;strong&gt;Axios&lt;/strong&gt;, and &lt;strong&gt;ESLint&lt;/strong&gt; provides a solid foundation for building scalable applications. But what if you want a fast and efficient bundling tool to speed up your development process? Enter &lt;strong&gt;esbuild&lt;/strong&gt;—a fast bundler and minifier that will help you compile TypeScript code and bundle your application with ease.&lt;/p&gt;

&lt;p&gt;In this blog post, we will walk through setting up a &lt;strong&gt;Node.js project with TypeScript&lt;/strong&gt;, using &lt;strong&gt;esbuild&lt;/strong&gt; for bundling, and integrating &lt;strong&gt;Axios&lt;/strong&gt; for HTTP requests and &lt;strong&gt;ESLint&lt;/strong&gt; for maintaining code quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use TypeScript for Node.js?
&lt;/h2&gt;

&lt;p&gt;TypeScript provides type safety and improved tooling over plain JavaScript, allowing you to catch errors early and build maintainable applications. Benefits of using TypeScript include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type Safety&lt;/strong&gt;: Helps to catch type errors before runtime, reducing bugs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Developer Experience&lt;/strong&gt;: Tools like autocompletion and inline documentation make coding easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better Refactoring&lt;/strong&gt;: The strict typing allows for safer, easier code refactoring.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Use esbuild?
&lt;/h2&gt;

&lt;p&gt;While TypeScript provides the structure and safety for your code, bundlers like &lt;strong&gt;esbuild&lt;/strong&gt; help with bundling your TypeScript files into a single, optimized output for deployment. Esbuild offers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lightning-fast performance&lt;/strong&gt;: esbuild is known for its speed, offering quick builds and fast rebuilds during development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in minification&lt;/strong&gt;: Minifying your code for production is easy with esbuild.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simple configuration&lt;/strong&gt;: It’s simple to set up and integrates well with TypeScript projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features of the Node.js TypeScript Boilerplate with esbuild
&lt;/h2&gt;

&lt;p&gt;This boilerplate includes everything you need to get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt;: The project is configured to use modern TypeScript with &lt;code&gt;ESNext&lt;/code&gt; module support, enabling the latest JavaScript features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Axios&lt;/strong&gt;: Axios is pre-configured for making HTTP requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ESLint&lt;/strong&gt;: To ensure your code follows consistent coding standards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;esbuild&lt;/strong&gt;: Used for bundling your TypeScript code into a single output file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type Declarations&lt;/strong&gt;: Automatic generation of &lt;code&gt;.d.ts&lt;/code&gt; files for type support and IDE autocompletion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Set Up the Node.js TypeScript Boilerplate
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Clone the Repository
&lt;/h3&gt;

&lt;p&gt;First, clone the repository to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/johnretsas/node-ts-boilerplate.git
&lt;span class="nb"&gt;cd &lt;/span&gt;node-ts-boilerplate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Run the following command to install the necessary dependencies:&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 will install all required packages, including TypeScript, Axios, ESLint, &lt;code&gt;esbuild&lt;/code&gt;, and &lt;code&gt;tsx&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Run the Project
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Development Mode
&lt;/h4&gt;

&lt;p&gt;To start the application in development mode with hot-reloading, run:&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 will use &lt;code&gt;tsx&lt;/code&gt; to automatically reload the application when changes are detected in the source files.&lt;/p&gt;

&lt;h4&gt;
  
  
  Build the Application
&lt;/h4&gt;

&lt;p&gt;To compile your TypeScript code into a bundled JavaScript file using esbuild, run:&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 build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;build.js&lt;/code&gt; script uses esbuild to bundle your TypeScript files and outputs the result to &lt;code&gt;dist/bundle.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here's a quick look at the &lt;code&gt;build.js&lt;/code&gt; script:&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;build&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;esbuild&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;isProd&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;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Check if we're in production&lt;/span&gt;

&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;entryPoints&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;./src/index.ts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;outfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./dist/bundle.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;resolveExtensions&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;.ts&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;.tsx&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;.js&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;.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;sourcemap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isProd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Enable source maps in development&lt;/span&gt;
  &lt;span class="na"&gt;minify&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;isProd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Minify in production&lt;/span&gt;
  &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;esnext&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Target modern JavaScript&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="k"&gt;catch&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;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;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Exit process if build fails&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Start the Application
&lt;/h4&gt;

&lt;p&gt;Once the project is built, you can start the application 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 start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will run the compiled &lt;code&gt;bundle.js&lt;/code&gt; from the &lt;code&gt;dist/&lt;/code&gt; folder.&lt;/p&gt;

&lt;h4&gt;
  
  
  Clean Build Files
&lt;/h4&gt;

&lt;p&gt;To remove the compiled build files, run:&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 clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Lint Your Code
&lt;/h3&gt;

&lt;p&gt;To maintain code quality, run ESLint to check for errors or issues:&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 lint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will run ESLint across your project and provide feedback on any issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Type Checking
&lt;/h3&gt;

&lt;p&gt;You can perform type checking to ensure that your TypeScript code is correctly typed without generating output files using:&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 type-check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will validate the types in your TypeScript files based on the settings in your &lt;code&gt;tsconfig.json&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development vs. Production
&lt;/h2&gt;

&lt;p&gt;In your build process, it’s important to distinguish between development and production environments. In &lt;strong&gt;development&lt;/strong&gt;, you want fast rebuilds with source maps enabled for easier debugging. In &lt;strong&gt;production&lt;/strong&gt;, however, you should minify your code to reduce file size and improve load times.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;build.js&lt;/code&gt; script checks the &lt;code&gt;NODE_ENV&lt;/code&gt; environment variable to adjust the configuration for each environment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Development&lt;/strong&gt;: Enables source maps and skips minification for faster rebuilds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production&lt;/strong&gt;: Minifies the code to reduce file size and excludes source maps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This boilerplate gives you a fast and efficient way to develop and bundle your Node.js applications with TypeScript, Axios, ESLint, and &lt;strong&gt;esbuild&lt;/strong&gt;. By using &lt;strong&gt;esbuild&lt;/strong&gt; for bundling, you're getting a lightning-fast build process, and the combination of &lt;strong&gt;TypeScript&lt;/strong&gt; and &lt;strong&gt;Axios&lt;/strong&gt; ensures a robust and maintainable codebase.&lt;/p&gt;

&lt;p&gt;For more information on the tools used in this boilerplate, check out the following resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/docs/" rel="noopener noreferrer"&gt;TypeScript Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://axios-http.com/docs/intro" rel="noopener noreferrer"&gt;Axios Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://esbuild.github.io/" rel="noopener noreferrer"&gt;esbuild Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eslint.org/docs/" rel="noopener noreferrer"&gt;ESLint Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>node</category>
      <category>boilerplate</category>
      <category>typescript</category>
      <category>axios</category>
    </item>
  </channel>
</rss>
