<?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: Michael Willian Santos</title>
    <description>The latest articles on Forem by Michael Willian Santos (@daxsoft).</description>
    <link>https://forem.com/daxsoft</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%2F279844%2Fcf6de3ff-72ee-49a3-b619-aba1dcbc056e.png</url>
      <title>Forem: Michael Willian Santos</title>
      <link>https://forem.com/daxsoft</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/daxsoft"/>
    <language>en</language>
    <item>
      <title>Prisma Backup</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Sat, 30 Aug 2025 12:24:23 +0000</pubDate>
      <link>https://forem.com/daxsoft/prisma-backup-24e3</link>
      <guid>https://forem.com/daxsoft/prisma-backup-24e3</guid>
      <description>&lt;p&gt;Github: &lt;a href="https://github.com/DaxSoft/prisma-backup" rel="noopener noreferrer"&gt;https://github.com/DaxSoft/prisma-backup&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple PostgreSQL Backups for Your Prisma Project
&lt;/h2&gt;

&lt;p&gt;You're building an awesome project with Prisma and a free PostgreSQL database from a cloud provider. It's fast, it's modern, it's great... until you realize the free tier doesn't offer a way to export or back up your data, neither it allows to connect to pgAdmin. How do you migrate to another service? What if you need to recover from a mistake?&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Ideal Use Cases
&lt;/h3&gt;

&lt;p&gt;This tool is perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Migrating off a free-tier service:&lt;/strong&gt; This is the primary use case. You can easily dump your entire database and move to a different provider without getting locked in.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Seeding development environments:&lt;/strong&gt; Quickly populate your local or staging database with a snapshot of production data.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Manual recovery:&lt;/strong&gt; Provides a safety net before performing major, destructive schema changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  ⚠️ A Quick Word of Caution
&lt;/h3&gt;

&lt;p&gt;This tool is designed for convenience and is &lt;strong&gt;best suited for small-sized projects&lt;/strong&gt;. It is not a substitute for enterprise-grade, point-in-time recovery solutions. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 1: Installation
&lt;/h3&gt;

&lt;p&gt;First, add the package 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;&lt;span class="c"&gt;# Using npm&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; @vorlefan/prisma-backup

&lt;span class="c"&gt;# Using yarn&lt;/span&gt;
yarn add @vorlefan/prisma-backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Creating a Backup
&lt;/h3&gt;

&lt;p&gt;The backup process is straightforward. You create an instance of the &lt;code&gt;PrismaBackup&lt;/code&gt; class, passing it your Prisma Client and some configuration.&lt;/p&gt;

&lt;p&gt;Let's create a script called &lt;code&gt;backup.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// backup.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&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;output/generated/prisma/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaBackup&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;@vorlefan/prisma-backup&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;prisma&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;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&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="s1"&gt;Starting backup...&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;backup&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;PrismaBackup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The root folder where all backup folders will be created&lt;/span&gt;
    &lt;span class="na"&gt;folderName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.db_backups&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;postgres&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="c1"&gt;// Optional: Handle large tables by fetching data in batches&lt;/span&gt;
    &lt;span class="na"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Posts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="c1"&gt;// Backup the 'Posts' table in batches of 200&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;backup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&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;✅ Backup completed!&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="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run this (&lt;code&gt;ts-node backup.ts&lt;/code&gt;), it will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Query all your PostgreSQL tables.&lt;/li&gt;
&lt;li&gt; Create a new folder inside &lt;code&gt;.db_backups&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; Save the data for each table as a separate JSON file.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Restoring From a Backup
&lt;/h3&gt;

&lt;p&gt;Restoring is just as simple, but with one critical requirement: you must provide Prisma's schema metadata. This allows the tool to understand your table relationships and insert data in the correct order to avoid foreign key constraint errors.&lt;/p&gt;

&lt;p&gt;Let's create &lt;code&gt;restore.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// restore.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Prisma&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;output/generated/prisma/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaRestore&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;@vorlefan/prisma-backup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Important: Import the 'Prisma' namespace to access the DMMF&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prisma&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;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&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="s1"&gt;Starting restore...&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;restore&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;PrismaRestore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The specific backup folder you want to restore from&lt;/span&gt;
    &lt;span class="na"&gt;folderName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.db_backups&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;postgres&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="c1"&gt;// THIS IS THE MOST IMPORTANT PART!&lt;/span&gt;
    &lt;span class="c1"&gt;// It allows the tool to understand your schema and relations.&lt;/span&gt;
    &lt;span class="na"&gt;baseModels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dmmf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;datamodel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;models&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;restore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&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;✅ Restore completed!&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="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run this script, it will automatically:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Analyze your &lt;code&gt;baseModels&lt;/code&gt; to determine the correct insertion order (e.g., &lt;code&gt;User&lt;/code&gt; before &lt;code&gt;Posts&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt; Insert the backup data table-by-table.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;And that's it! You now have a simple and effective strategy for backing up and migrating your Prisma project's database. &lt;/p&gt;

&lt;p&gt;Check out the repository on GitHub for more details. Happy coding&lt;/p&gt;

</description>
      <category>prisma</category>
      <category>postgres</category>
    </item>
    <item>
      <title>How to promote my product?</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Sat, 03 May 2025 16:09:41 +0000</pubDate>
      <link>https://forem.com/daxsoft/how-to-promote-my-product-73e</link>
      <guid>https://forem.com/daxsoft/how-to-promote-my-product-73e</guid>
      <description>&lt;p&gt;Newbie as an owner by building a writing platform for writers and storytellers.&lt;/p&gt;

&lt;p&gt;How do I start to promote my product? Any advice? I'm in full "Macbeth" mode for my product to change my family's life for the better.&lt;/p&gt;

&lt;p&gt;Any doubt on the technical side, I'm in for answering. 👻&lt;/p&gt;

&lt;p&gt;Context of the platform: The ultimate platform designed to empower you, fellow wordsmith, to showcase your novel in the most captivating manner.&lt;br&gt;
Let your words shine for everyone to discover.&lt;/p&gt;

&lt;p&gt;Built with: Prisma, NextJS, Typescript, Redis, Shadcn (Tailwind), AWS, Trigger Dev, Cloudflare, Vercel.&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="https://www.travelerspentales.com/" rel="noopener noreferrer"&gt;https://www.travelerspentales.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>saas</category>
      <category>discuss</category>
      <category>community</category>
    </item>
    <item>
      <title>Prisma - Backup System</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Sat, 05 Feb 2022 18:30:28 +0000</pubDate>
      <link>https://forem.com/daxsoft/prisma-backup-system-n6f</link>
      <guid>https://forem.com/daxsoft/prisma-backup-system-n6f</guid>
      <description>&lt;center&gt;// start&lt;/center&gt;

&lt;p&gt;Hi everyone! &lt;br&gt;
&lt;a href="https://github.com/DaxSoft/prisma-backup" rel="noopener noreferrer"&gt;GitHub of the Project&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Use this module to create a backup measure for your project that uses Prisma. You can either backup the information, or use them to migrate to another database, or just to reset the database.&lt;br&gt;
Example: Let's say that you need to change a unique key (email) to another like (code). You can backup first,&lt;br&gt;
then change the schema.prisma, and use this module to inject the old information.&lt;/p&gt;



&lt;center&gt;// How To Use&lt;/center&gt;

&lt;p&gt;Basic example using the Prisma, let's imagine that we have two models, User &amp;amp; Post. And the Post model is related to the User model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&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;PrismaClient&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;@prisma/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;backup&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;@vorlefan/prisma-backup&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;prisma&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;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;void &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;function &lt;/span&gt;&lt;span class="p"&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;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;$transaction&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;prisma&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="nf"&gt;findMany&lt;/span&gt;&lt;span class="p"&gt;({}),&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findMany&lt;/span&gt;&lt;span class="p"&gt;({})]);&lt;/span&gt;

    &lt;span class="c1"&gt;// w/out encrypt&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;backup&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;models&lt;/span&gt;&lt;span class="p"&gt;:&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="p"&gt;});&lt;/span&gt;

    &lt;span class="c1"&gt;// encrypting the models&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;backup&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;models&lt;/span&gt;&lt;span class="p"&gt;:&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="na"&gt;encrypt&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;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pwd123&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;backupFolderName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;encrypted&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;center&gt;// End&lt;/center&gt;

&lt;p&gt;There a lot of feature that I'm planning for this module, then if you want to, please contribute or follow up the news xD&lt;/p&gt;

</description>
      <category>prisma</category>
      <category>typescript</category>
      <category>database</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Google News | Crawler</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Sat, 31 Oct 2020 19:01:27 +0000</pubDate>
      <link>https://forem.com/daxsoft/google-news-crawler-31n7</link>
      <guid>https://forem.com/daxsoft/google-news-crawler-31n7</guid>
      <description>&lt;center&gt;// start&lt;/center&gt;

&lt;p&gt;Hi everyone! &lt;br&gt;
&lt;a href="https://github.com/DaxSoft/google-news" rel="noopener noreferrer"&gt;GitHub of the Project&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;While I was coding a paid-project from my freelancer career. There was the need to get news from certain topics. I have searched and discovered that there are few solutions for this particular problem. So, this is the reason that I have created this package.&lt;/p&gt;



&lt;center&gt;// How To Use&lt;/center&gt;

&lt;p&gt;It's pretty simple to use, in which you need to only define the class and call for the method run (async/await)&lt;/p&gt;

&lt;p&gt;Example taken from the folder 'example/basic' at the github page.&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;GoogleNews&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;@vorlefan/google-news&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;news&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;GoogleNews&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;One Piece&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;Kingkiller Chronicles&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;routeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;download&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en-US&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;localization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;US&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;route&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;route&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;src&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;download&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;src&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;route&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;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;filepath&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="k"&gt;void &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;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&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;center&gt;// Use Case&lt;/center&gt;

&lt;p&gt;If you are creating a web-app, SaaS or whatever that needs to crawler the most recent news from certain topic, this is for you :)&lt;/p&gt;




&lt;center&gt;// End&lt;/center&gt;

&lt;p&gt;There a lot of feature that I'm planning for this module, then if you want to, please contribute or follow up the news xD&lt;/p&gt;

</description>
      <category>node</category>
      <category>tool</category>
      <category>google</category>
      <category>crawler</category>
    </item>
    <item>
      <title>Brand : crawler to get up-to-date brand assets</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Wed, 01 Jul 2020 21:35:01 +0000</pubDate>
      <link>https://forem.com/daxsoft/brand-crawler-to-get-up-to-date-brand-assets-dmo</link>
      <guid>https://forem.com/daxsoft/brand-crawler-to-get-up-to-date-brand-assets-dmo</guid>
      <description>&lt;center&gt;// start&lt;/center&gt;

&lt;p&gt;Hi everyone! &lt;br&gt;
&lt;a href="https://github.com/DaxSoft/brand" rel="noopener noreferrer"&gt;GitHub of the Project&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;One of the projects I am working has a page where you can search for stock market enterprises (company). One of my struggles of the project was the requirement to get the brand logo of the company. So I was searching around the web several tools to make it more easy... I have found some, however, either the price was not affordable or the tool itself not attend all my needs. So I have decided to create one using the concept of 'scraping into the web'.&lt;/p&gt;



&lt;center&gt;// How To Use&lt;/center&gt;

&lt;p&gt;Warn: It is not ready for production.&lt;br&gt;
To use it you need to install on your Node project the package 'puppeteer' and this one '@vorlefan/brand'.&lt;br&gt;
The function itself is really easy to use. Few options, you can read the doc on the github page.&lt;/p&gt;

&lt;p&gt;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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BrandCrawler&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;@vorlefan/brand&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&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;puppeteer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.lojasrenner.com.br/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;void &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;function &lt;/span&gt;&lt;span class="p"&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;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;BrandCrawler&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;website&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;e9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;instagram&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;pageTimeout&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="na"&gt;twitter&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;facebook&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="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;test&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;The return you can find on the github page (I don't want to polute this post here xD)&lt;/p&gt;




&lt;center&gt;// Use Case&lt;/center&gt;

&lt;p&gt;If you are building a 'brand search' or the app that you are creating requires the logo and banner from the enterprise in question, I guess that this will suit you pretty well :)&lt;/p&gt;




&lt;center&gt;// End&lt;/center&gt;

&lt;p&gt;There a lot of feature that I'm planning for this module, then if you want to, please contribute or follow up the news xD&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>node</category>
      <category>brand</category>
      <category>tool</category>
    </item>
    <item>
      <title>Convert XLSX file into JSON</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Thu, 25 Jun 2020 14:11:45 +0000</pubDate>
      <link>https://forem.com/daxsoft/convert-xlsx-file-into-json-3m4g</link>
      <guid>https://forem.com/daxsoft/convert-xlsx-file-into-json-3m4g</guid>
      <description>&lt;center&gt;// start&lt;/center&gt;

&lt;p&gt;Hi everyone! &lt;br&gt;
&lt;a href="https://github.com/DaxSoft/xlsx" rel="noopener noreferrer"&gt;GitHub of the Project&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I was working into a PaaS that requires to read a .xls|xlsx file and extract the data into a readable .json, in which will be sent for the database. Seeking around the web, I found the amazing 'mongo-xlsx', however, the data generated was a messy. So, I had the idea to create a package around the 'mongo-xlsx', in which I would use the other package 'string-similarity', to construct a better parse. In the end, it worked as I wanted and needed for the project. Then, I had decide to construct a 'better one' from the one I have built to share with everyone. Please, if you can contribute with pull-requests, do it. I guess that this package can be pretty useful for everyone to use :)&lt;/p&gt;




&lt;center&gt;// How To Use&lt;/center&gt;

&lt;p&gt;The package is really simple to use. By justing taking a look at the main README.md and the examples, I guess that you guys can see how to use. However, whatever doubt about it, just ask here :)&lt;/p&gt;




&lt;center&gt;// Use Case&lt;/center&gt;

&lt;p&gt;As given by the &lt;a href="https://github.com/DaxSoft/xlsx/tree/master/examples/intermediate" rel="noopener noreferrer"&gt;example intermediate&lt;/a&gt;, the main motive that leads me to create this package, it is an application that I'm making. I had the problem and the needs to convert a lot of .xlsx file into .json one for the Database. The big problem of this, is that the .xlsx was pretty complex (from stock market).&lt;/p&gt;

&lt;p&gt;With this package, I could transform that .xlsx file from the cover page, into a .json data. Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8vqukizz9qev1pjh6awc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8vqukizz9qev1pjh6awc.png" alt="Alt Text" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sure thing, after it, there is the need to sanitize and so on. &lt;/p&gt;




&lt;center&gt;// End&lt;/center&gt;

&lt;p&gt;I hope that this package — that will be improved by time, helps someone in their needs. Please, if you can, contribute to the project. I guess that it will help a lot of people xD&lt;/p&gt;

</description>
      <category>node</category>
      <category>typescript</category>
      <category>xlsx</category>
      <category>data</category>
    </item>
    <item>
      <title>How I Built My Portfolio</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Sun, 19 Apr 2020 21:16:01 +0000</pubDate>
      <link>https://forem.com/daxsoft/how-i-built-my-portfolio-436m</link>
      <guid>https://forem.com/daxsoft/how-i-built-my-portfolio-436m</guid>
      <description>&lt;p&gt;Hello, everyone :)&lt;br&gt;
Link: &lt;a href="https://github.com/DaxSoft/daxsoft.github.io" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;br&gt;
Site: &lt;a href="https://daxsoft.github.io/" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I have been using Next.js for a while. And my portfolio on Github was very outdated. For this motive, I have creating a new other using Next.JS. By far the most annoying thing to resolve was the problem of exporting the application to work with the Github Pages. There are not that many of tutorial or example, that explains in a clear way.&lt;/p&gt;

&lt;p&gt;Then, if you guys want to, check out the source code of the website :)&lt;/p&gt;




&lt;h1&gt;
  
  
  Features
&lt;/h1&gt;

&lt;p&gt;Things that I was seeking on have in my portfolio:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear and simple&lt;/li&gt;
&lt;li&gt;Shows up my project that I have on Behance&lt;/li&gt;
&lt;li&gt;Shows up the projects on my Github&lt;/li&gt;
&lt;li&gt;Be the host of some project's documentation&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Behance
&lt;/h1&gt;

&lt;p&gt;I don't want to have any time that I publish a new project on Behance, go on my portfolio then edit some sort of file or anything like this to display the info of this project. &lt;/p&gt;

&lt;p&gt;Then, I have use the Puppeteer to scrape my projects on Behance, grab the pictures and some statics, and generate a json file.&lt;/p&gt;

&lt;p&gt;With the Github Actions, I will automate this process using some sort of CRON time.&lt;/p&gt;




&lt;h1&gt;
  
  
  Github
&lt;/h1&gt;

&lt;p&gt;Using the Github's API, I could get my project list that it's mine (not forked).&lt;br&gt;
I have created some sort of 'To-Do' for this website, in which is getting the list of open issues from the Github repo. and displaying on Website.&lt;/p&gt;




&lt;h1&gt;
  
  
  Github Project's Documentation
&lt;/h1&gt;

&lt;p&gt;Every project of mine that have on his description from the Github repository, the keyword '#docs'. It will be available on Website to see the documentation.&lt;br&gt;
With the Github's API, I can went into this repositories, look at if it haves a folder named 'docs', then it will render on the website, using React Markdown.&lt;/p&gt;




&lt;p&gt;Well, for while is it :)&lt;/p&gt;

</description>
      <category>react</category>
      <category>github</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>React Hooks | My Package</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Sat, 04 Apr 2020 16:59:28 +0000</pubDate>
      <link>https://forem.com/daxsoft/react-hooks-my-package-5fj1</link>
      <guid>https://forem.com/daxsoft/react-hooks-my-package-5fj1</guid>
      <description>&lt;center&gt;#start&lt;/center&gt;

&lt;p&gt;Hi everyone! &lt;br&gt;
&lt;a href="https://github.com/DaxSoft/react-hooks" rel="noopener noreferrer"&gt;GitHub of the Project&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;I have been using React for about 7 months already. And by this, I have created a lot of Hooks and other stuff to made my life easy. So by this, I have created a suit of react hooks to help me. In which, I have been using in whatever 'react-project' I made.&lt;/p&gt;



&lt;ul&gt;
&lt;li&gt;useAsync : Handle with Async Functions &lt;/li&gt;
&lt;li&gt;useBoolean : Better way with a good semantic to handle with Boolean states&lt;/li&gt;
&lt;li&gt;useClient : Useful for server-side apps, in which you can check up it is under Server-Side or Client-Side&lt;/li&gt;
&lt;li&gt;useDebounce : For functions that the user can call any time &lt;/li&gt;
&lt;li&gt;useFetch : A complete tool to handle with requests from API. &lt;/li&gt;
&lt;li&gt;useIndex : With this you can handle with 'Pagination' or whatever use the concept of 'Page Index', 'Per Page'&lt;/li&gt;
&lt;li&gt;useKeyboard : Identify the key pressed &lt;/li&gt;
&lt;li&gt;useLocalStorage : Save values it and get the values on LocalStorage&lt;/li&gt;
&lt;li&gt;useMiddleMouse : Identify if the user is using the MiddleMouse (scrolling)&lt;/li&gt;
&lt;li&gt;useMouseOut : Identify if the mouse cursor is out of the range of the element&lt;/li&gt;
&lt;li&gt;useMouseIn : Identify if the mosue cursor is inside of the range of the element&lt;/li&gt;
&lt;li&gt;useObject : Better way to handle with Object values&lt;/li&gt;
&lt;li&gt;useScreenSize : Identify the size of the Window and the orientation of the screen.&lt;/li&gt;
&lt;li&gt;useScroll : Identify the state of the scroll of the page&lt;/li&gt;
&lt;li&gt;useToggle : Useful to handle with Toggle elements like 'Tabs' and so on.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;I'm currently building up the Docs for this package and editing to give you guys a better example. So, I'll be really happy if you guys give me a feedback xD&lt;/p&gt;



&lt;p&gt;Example: (Next.js + React + Fastify)&lt;/p&gt;

&lt;p&gt;It's a simple example of search repository on Github.&lt;br&gt;
To check up, clone the folder 'example' on the repository of this Project. And run up:&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;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7mmah0mejaqcxmokq2w1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7mmah0mejaqcxmokq2w1.png" alt="Alt Text" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>hooks</category>
    </item>
    <item>
      <title>JavaScript - Abbreviate Numbers</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Thu, 12 Mar 2020 03:55:36 +0000</pubDate>
      <link>https://forem.com/daxsoft/javascript-abbreviate-numbers-2l7m</link>
      <guid>https://forem.com/daxsoft/javascript-abbreviate-numbers-2l7m</guid>
      <description>&lt;h1&gt;
  
  
  Case
&lt;/h1&gt;

&lt;p&gt;I am working into a website in which I handle with a lot of data and by this, the end user (client) shall see the results and values. So, I was caught into a problem... The overall display of the values.&lt;br&gt;
 While in some cases for the user, it will be interesting to see the raw value (like, 13.640.333.000)... in another, just the abbreviation of the  value will be acceptable (13.64 B).&lt;br&gt;
 So I went to look forward a way to solve this problem of mine — looking around the community. But, the scripts that I have found either is "heavy" for this purpose or it is very fancy for this.&lt;br&gt;
 Then... I end up creating my own, tiny solution... &lt;/p&gt;
&lt;h1&gt;
  
  
  Warning
&lt;/h1&gt;

&lt;p&gt;As I'm pretty busy with my works recently, I'll not be able to share my codes with the community (I'll share some 'react hooks' and snippets that I use often).&lt;br&gt;
However, since I feel that this can be very useful... I'll share here xD&lt;/p&gt;
&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * Abrreviete the number by unit
 * @param {Number|String} number
 * @param {Object} config
 * @param {Boolean} config.absolute if it will replace the 'x.yyy', '.yyy', for
 * empty space. Like, '13.4' to '13'
 * @param {Number} config.factor the factor on 'toFixed'
 * @param {Array} config.unit
 * @param {Boolean} config.numeric if the final value will be the type 'number'
 * or 'string'
 */&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;abbreviate&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{})&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="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;object&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&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="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;hasOwnProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;factor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;factor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&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;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hasOwnProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;absolute&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;absolute&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&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;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hasOwnProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;unit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&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;K&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;M&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;B&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;T&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;Q&lt;/span&gt;&lt;span class="dl"&gt;'&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="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;hasOwnProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;numeric&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;numeric&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;(\.&lt;/span&gt;&lt;span class="sr"&gt;|&lt;/span&gt;&lt;span class="se"&gt;\)&lt;/span&gt;&lt;span class="sr"&gt;|&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="sr"&gt;|&lt;/span&gt;&lt;span class="se"&gt;\,)&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unit_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;~~&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;`parseFloat(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; / 1e&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;unit_index&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;).toFixed(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;factor&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;)`&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;//console.log(config)&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;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\.(\d&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;$/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&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="nx"&gt;numeric&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;unit_index&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;

&lt;h1&gt;
  
  
  How to Use
&lt;/h1&gt;

&lt;p&gt;Copy the code on the DevTools of your Browser and let's test it xD&lt;/p&gt;
&lt;h2&gt;
  
  
  Default
&lt;/h2&gt;

&lt;p&gt;You can use the standard way...&lt;br&gt;
 Like:&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="nf"&gt;abbreviate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123458886&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// "123 M"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or to control decimal places&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="nf"&gt;abbreviate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123458886&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;absolute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;factor&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="c1"&gt;// "123.459 M"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Bye
&lt;/h1&gt;

&lt;p&gt;Well, that is it... If it helps you or if you have some feedback/suggestion, let me know :)... Any doubt, please, comment as well &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>snippet</category>
      <category>utils</category>
    </item>
    <item>
      <title>My first month with React</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Tue, 24 Dec 2019 23:39:37 +0000</pubDate>
      <link>https://forem.com/daxsoft/my-first-month-with-react-om7</link>
      <guid>https://forem.com/daxsoft/my-first-month-with-react-om7</guid>
      <description>&lt;h1&gt;
  
  
  &lt;center&gt;What is this about?&lt;/center&gt;
&lt;/h1&gt;

&lt;p&gt;One month ago, at 24/11/2019, I was talking with my client in which road his web application should go. Giving him pointers and asking what he thinks about it. Then I have talked with him about the React and NextJS, telling that for his application it would be the ideal — it's a website about analise of stocks &amp;amp; assets with a community to interact. Then we decided to choose this two frameworks.&lt;/p&gt;

&lt;p&gt;However, I never have used this two frameworks before on my life — of course, I have told him about it, that it would be the first time of me using it, he agreed and told me that trust me. Then, I went to battle.&lt;/p&gt;

&lt;p&gt;My background with Javascript was pure Javascript + NodeJS (and his several possibilites). Never ever used a framework before xD. But I was not afraid of trying it out, my last two years was pure javascript, so I decided to "take on ship".&lt;/p&gt;



&lt;h1&gt;
  
  
  &lt;center&gt;First week&lt;/center&gt;
&lt;/h1&gt;

&lt;p&gt;It was everything so confuse, I mean, the whole concept of using both 'html' with javascript and so on. I was very lost, then I have did what every developer should do: be friend of the docs of both frameworks and taking a look at several codes on projects over GitHub, trying to understand the concepts and so on.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;center&gt;Second week&lt;/center&gt;
&lt;/h1&gt;

&lt;p&gt;I was stuck trying to understand the React Hooks and how to make the 'ui-library' of the Material-UI, works fine with NextJS. Then I went to understand about the 'initialProps' and how works the lifecycle of React and NextJS&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;center&gt;Third week&lt;/center&gt;
&lt;/h1&gt;

&lt;p&gt;After create some pretty small projects to practice what I have learned, I had the feel that was about time to start the big project with this two frameworks. &lt;br&gt;
Over this week I have created 4 pages, but I will only show up one because the project isn't complete and I cannot show up everything yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6jil5p3hx4c9jg9kfe4f.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6jil5p3hx4c9jg9kfe4f.gif" alt="First Version" width="600" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;center&gt;Last Week&lt;/center&gt;
&lt;/h1&gt;

&lt;p&gt;Well, I think I have enought confidence to go on with the project on both frameworks. Of course, I could have choose to work on my comfort zone, with pure Javascript, however... I know that I'm not coding to myself, it will have a lot of coders on future and I want to make easy for them xD. Then, let's go on...&lt;/p&gt;



&lt;h1&gt;
  
  
  &lt;center&gt;What I've learned&lt;/center&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;It's fun to get out of your comfort zone &lt;/li&gt;
&lt;li&gt;Take it as law, at least that your project is just for fun and for yourself, always code thinking that others will look at your code and develop over your lines.&lt;/li&gt;
&lt;li&gt;At first everything is confuse and it's normal to be. Then, don't take it at your heart, if you are feeling stuck with something, go out for some hang out, running, sport or make stuffs that you enjoy. Then, after it, go back at your project. You will feel that what previous you thought of being a big mountain, hard to fight out, was a little stone on your shoes worths of a good laugh. So go, go laugh of yourself, it will make you more healthly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy784ntpw8uk171ul8gye.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy784ntpw8uk171ul8gye.gif" alt="Second Version" width="760" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>node</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>My first NPM module</title>
      <dc:creator>Michael Willian Santos</dc:creator>
      <pubDate>Wed, 27 Nov 2019 17:58:44 +0000</pubDate>
      <link>https://forem.com/daxsoft/my-first-npm-module-35l8</link>
      <guid>https://forem.com/daxsoft/my-first-npm-module-35l8</guid>
      <description>&lt;center&gt;#start&lt;/center&gt;

&lt;p&gt;Hi everyone! &lt;br&gt;
&lt;a href="https://github.com/DaxSoft/path_route" rel="noopener noreferrer"&gt;GitHub of the Project&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;For my first post here I have think about sharing my first NPM module. &lt;/p&gt;

&lt;p&gt;First of all I'm not an newbie into coding neither on JavaScript language, however I never thought to share some application that I write, that in overall helps me in production time and so on. &lt;/p&gt;

&lt;p&gt;But, getting so much from open source and community, I have decided that it's time for me to start sharing some application, libraries and snippets that I usually write and use on my projects.&lt;/p&gt;



&lt;center&gt;#vorlefan.path_route&lt;/center&gt;

&lt;p&gt;&lt;strong&gt;What is it about&lt;/strong&gt;? The main functions is to given the power of easily manage the access to the folders and files of your project. With the ability to handle files (&lt;em&gt;example: read json file&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I have created this?&lt;/strong&gt; I was tired of typing '../../../../someName/file.json' everytime on my projects. Or being almost all time using 'path.resolve' to not get some errors.&lt;/p&gt;



&lt;center&gt;#example&lt;/center&gt;

&lt;p&gt;In my current project that I'm working at the back-end with NodeJS and at the front-end with React (NextJS). I have a folder named 'server', inside of this folder I have my structure of folders and two javascript file. '&lt;strong&gt;index.js&lt;/strong&gt;', that executes the server and '&lt;strong&gt;path_route.js&lt;/strong&gt;', that handles with the structure of my path routes. Take a look:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n1rh5ocbbw38yn3fd13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n1rh5ocbbw38yn3fd13.png" width="244" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The main reason that my '&lt;strong&gt;path_route.js&lt;/strong&gt;' is at the main folder, is just to have the __dirname directed to the main folder. This make easy my life.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now the code (I'll not show up the complete code to not make this post big)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3a6ydo3fnoxggejcnqay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3a6ydo3fnoxggejcnqay.png" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this piece of code, I can access my folders easily, example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To access my 'assets' folder:&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Main&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;assets&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// it returns&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&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="s2"&gt;assets&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="s2"&gt;path&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="s2"&gt;__dirname/assets&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;And my module.exports to make it more general for my overall application is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91qjpnnipiv7tougy8ov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91qjpnnipiv7tougy8ov.png" width="800" height="906"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;With this I'll only need to require this file, to access the overall structure of folders and files of my project.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Access the folder structure of my folder 'assets'.&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Assets&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;../../../path_route&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Assets&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;center&gt;#end&lt;/center&gt;

&lt;p&gt;Sure things there are a lot of room to improvement and features to add, however I'm pretty enjoyed this module of mine and to be first in both publishing and experience in using 'npm publish', I feel that it's okay xD.&lt;/p&gt;

&lt;p&gt;It would be nice to receive some feedback and suggestions :)&lt;/p&gt;

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