<?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: sharefun2023</title>
    <description>The latest articles on DEV Community by sharefun2023 (@sharefun2023).</description>
    <link>https://dev.to/sharefun2023</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4038465%2F0efe338c-5e60-4e6d-ae98-f674cfd4a893.png</url>
      <title>DEV Community: sharefun2023</title>
      <link>https://dev.to/sharefun2023</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sharefun2023"/>
    <language>en</language>
    <item>
      <title>How I Built a Free SVG to PNG Converter in 1 Hour</title>
      <dc:creator>sharefun2023</dc:creator>
      <pubDate>Tue, 04 Aug 2026 08:05:54 +0000</pubDate>
      <link>https://dev.to/sharefun2023/how-i-built-a-free-svg-to-png-converter-in-1-hour-4ci9</link>
      <guid>https://dev.to/sharefun2023/how-i-built-a-free-svg-to-png-converter-in-1-hour-4ci9</guid>
      <description>&lt;p&gt;I needed a quick way to convert SVG icons to PNG for a project. Every online converter I found required uploading files to a server — slow, privacy-invasive, and overkill for a 2KB icon.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://imgloft.com" rel="noopener noreferrer"&gt;imgloft.com&lt;/a&gt;&lt;/strong&gt; — a free, client-side SVG to PNG converter that works entirely in your browser. No uploads, no server, 100% private.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Most online SVG-to-PNG tools follow the same pattern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload your SVG to their server&lt;/li&gt;
&lt;li&gt;Server runs a conversion library (ImageMagick, librsvg, etc.)&lt;/li&gt;
&lt;li&gt;Download the result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is fine for occasional use, but it breaks down when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're working with sensitive design assets&lt;/li&gt;
&lt;li&gt;The file is large and upload takes forever&lt;/li&gt;
&lt;li&gt;You're offline or behind a restrictive firewall&lt;/li&gt;
&lt;li&gt;You just want to convert a tiny icon without waiting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The 1-Hour Solution
&lt;/h2&gt;

&lt;p&gt;The entire converter is built with three browser APIs:&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;// 1. Read the SVG file&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reader&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;FileReader&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;svgText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// 2. Draw it on a canvas at the desired resolution&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;img&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;Image&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;svgBlob&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;Blob&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;svgText&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;image/svg+xml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;svgBlob&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&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;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// 3. Export as PNG&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBlob&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;blob&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blob&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="c1"&gt;// Trigger download&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image/png&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="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readAsText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Three APIs, zero dependencies, zero server cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why It Only Took 1 Hour
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;No backend.&lt;/strong&gt; The entire tool runs in the browser using the Canvas API. No Express, no ImageMagick, no Docker container. Just a static HTML file served from Cloudflare Pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No auth.&lt;/strong&gt; Users don't need accounts — they come, convert, and leave. No database, no user management, no session tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No framework.&lt;/strong&gt; Plain HTML, vanilla JavaScript, and a few lines of CSS. No React, no build step, no node_modules.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Client-side is underrated.&lt;/strong&gt; The browser can do way more than we give it credit for. SVG rendering, image encoding, even basic image manipulation — all built in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ship the MVP.&lt;/strong&gt; I could have spent weeks adding batch conversion, format options, color filters. Instead I shipped the core feature in an afternoon and let users tell me what they need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free tools attract real users.&lt;/strong&gt; Within days of going live, Google started indexing the site. People are searching for "svg to png converter" — 40,000 times a month. The demand is real.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://imgloft.com" rel="noopener noreferrer"&gt;imgloft.com&lt;/a&gt;&lt;/strong&gt; — drag any SVG, get a PNG instantly. Also includes compress, resize, and crop tools.&lt;/p&gt;

&lt;p&gt;If you're thinking about building a micro-tool site, just do it. Ship the simplest version first. The browser is your backend.&lt;/p&gt;

</description>
      <category>svg</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Building a Client-Side SQL Formatter with Vanilla JS and Web Workers</title>
      <dc:creator>sharefun2023</dc:creator>
      <pubDate>Mon, 20 Jul 2026 15:35:46 +0000</pubDate>
      <link>https://dev.to/sharefun2023/building-a-client-side-sql-formatter-with-vanilla-js-and-web-workers-888</link>
      <guid>https://dev.to/sharefun2023/building-a-client-side-sql-formatter-with-vanilla-js-and-web-workers-888</guid>
      <description>&lt;p&gt;Most SQL formatters process queries server-side. That means every time you click "Format", your SQL gets sent to a random backend — with no guarantee of what happens to it.&lt;/p&gt;

&lt;p&gt;I wanted something different: &lt;strong&gt;a formatter where your data never leaves your browser.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://sqlformat.io" rel="noopener noreferrer"&gt;sqlformat.io&lt;/a&gt;&lt;/strong&gt; is built with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vanilla JavaScript&lt;/strong&gt; — no framework, no build step&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/sql-formatter-org/sql-formatter" rel="noopener noreferrer"&gt;sql-formatter&lt;/a&gt;&lt;/strong&gt; — the formatting engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Workers&lt;/strong&gt; — formatting runs off the main thread so the UI stays snappy even on 1000+ line queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare Pages&lt;/strong&gt; — zero-cost hosting with global edge caching&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User pastes SQL
  ↓
Main thread sends to Web Worker
  ↓
Worker calls sql-formatter with dialect-specific options
  ↓
Formatted SQL sent back to main thread
  ↓
Rendered with syntax highlighting (no library needed — just regex + &amp;lt;span&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key insight:&lt;/strong&gt; the sql-formatter library alone is ~50KB gzipped. Running it in a Web Worker means the main thread never blocks, and the user can keep typing while large queries format in the background.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why No Server?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt; — zero bytes leave the user browser&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline&lt;/strong&gt; — works after the page loads, no internet needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale&lt;/strong&gt; — no server costs, no rate limits, no API keys&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed&lt;/strong&gt; — no round trip, instant formatting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Web Workers are underrated&lt;/strong&gt; — they turn a potentially laggy text processor into a buttery-smooth UX&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL dialects are deceptively complex&lt;/strong&gt; — MySQL vs PostgreSQL vs BigQuery all have different quoting rules, and the formatter needs to handle inline comments and dollar-quoted strings that span multiple lines&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regex-based syntax highlighting works surprisingly well&lt;/strong&gt; for SQL — you do not need a parser, just a few well-placed regex patterns for keywords, strings, numbers, and comments&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Try it: &lt;a href="https://sqlformat.io" rel="noopener noreferrer"&gt;sqlformat.io&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Source: &lt;a href="https://github.com/sharefun2023/sqlformat.io" rel="noopener noreferrer"&gt;github.com/sharefun2023/sqlformat.io&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>I Got Tired of Slow SQL Formatters That Upload My Queries — So I Built a Free One</title>
      <dc:creator>sharefun2023</dc:creator>
      <pubDate>Mon, 20 Jul 2026 15:35:08 +0000</pubDate>
      <link>https://dev.to/sharefun2023/i-got-tired-of-slow-sql-formatters-that-upload-my-queries-so-i-built-a-free-one-129o</link>
      <guid>https://dev.to/sharefun2023/i-got-tired-of-slow-sql-formatters-that-upload-my-queries-so-i-built-a-free-one-129o</guid>
      <description>&lt;p&gt;I write a lot of SQL every day. And every online formatter I tried had the same problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Uploads queries to their server&lt;/strong&gt; — privacy nightmare when you are working with production schema&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tiny text area&lt;/strong&gt; — cannot handle 500+ line queries without lag&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3 ads&lt;/strong&gt; before you even see the formatted output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://sqlformat.io" rel="noopener noreferrer"&gt;sqlformat.io&lt;/a&gt;&lt;/strong&gt; — a no-BS SQL formatter.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client-side only&lt;/strong&gt; — everything runs in YOUR browser via Web Worker. Zero bytes leave your device&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;15+ SQL dialects&lt;/strong&gt; — MySQL, PostgreSQL, SQLite, BigQuery, Snowflake, T-SQL, and more&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No signup, no ads, no upload&lt;/strong&gt; — ever&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant&lt;/strong&gt; — paste, click Format, done&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I Built It
&lt;/h2&gt;

&lt;p&gt;I got tired of copy-pasting production queries into random websites and wondering where they ended up. With sqlformat.io, you can disconnect your internet after the page loads and keep formatting offline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra Tools Included
&lt;/h2&gt;

&lt;p&gt;It is not just a formatter — the site has several free SQL tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Diff&lt;/strong&gt; — compare two SQL queries side by side&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minify/Compress&lt;/strong&gt; — strip whitespace for embedding in code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate&lt;/strong&gt; — syntax check across dialects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ER Diagram&lt;/strong&gt; — visualize table relationships&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL to JSON&lt;/strong&gt; — convert query results&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Generator&lt;/strong&gt; — generate test data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explain Visualizer&lt;/strong&gt; — MySQL/PostgreSQL EXPLAIN output as a tree&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;Vanilla JS + &lt;a href="https://github.com/sql-formatter-org/sql-formatter" rel="noopener noreferrer"&gt;sql-formatter&lt;/a&gt; library, hosted on Cloudflare Pages. All formatting runs in a Web Worker so the UI stays responsive even on huge queries.&lt;/p&gt;




&lt;p&gt;Open source: &lt;a href="https://github.com/sharefun2023/sqlformat.io" rel="noopener noreferrer"&gt;github.com/sharefun2023/sqlformat.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love feedback from folks who format SQL daily!&lt;/p&gt;

</description>
      <category>sql</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
