<?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: Shayan Ali</title>
    <description>The latest articles on DEV Community by Shayan Ali (@shayanali).</description>
    <link>https://dev.to/shayanali</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%2F4230397%2Fd71fc49b-862c-4fda-9c67-7dba214a859e.png</url>
      <title>DEV Community: Shayan Ali</title>
      <link>https://dev.to/shayanali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shayanali"/>
    <language>en</language>
    <item>
      <title>PDF to Text in Your Browser: pdf-lib Can't Extract Text, but pdf.js Can</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Thu, 26 Nov 2026 16:10:55 +0000</pubDate>
      <link>https://dev.to/shayanali/pdf-to-text-in-your-browser-pdf-lib-cant-extract-text-but-pdfjs-can-47i9</link>
      <guid>https://dev.to/shayanali/pdf-to-text-in-your-browser-pdf-lib-cant-extract-text-but-pdfjs-can-47i9</guid>
      <description>&lt;p&gt;If you want the words out of a PDF without uploading the file anywhere, the answer is one function: &lt;code&gt;page.getTextContent()&lt;/code&gt; from Mozilla's pdf.js. And if you already build PDF tools with pdf-lib — the library from &lt;a href="https://dev.to/shayanali/merging-pdfs-without-uploading-them-how-pdf-lib-runs-entirely-in-your-browser-25p1"&gt;my merging post&lt;/a&gt; — here is the thing nobody tells you until you waste an afternoon on it: pdf-lib cannot extract text at all. Both "do PDFs in JavaScript", but they do opposite halves of the job, and picking the wrong one is the most common dead end in browser PDF work.&lt;/p&gt;

&lt;p&gt;Below: what pdf.js does, the exact code already running in one of my production tools, and a real test on two real PDFs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: pdf-lib is the wrong library for this job
&lt;/h2&gt;

&lt;p&gt;My PDF merger runs on pdf-lib, so when I needed text out of a PDF, I reached for the same library first. I checked the only way that settles it:&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="nc"&gt;PDFDocument&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'pdf-lib'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getOwnPropertyNames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDFDocument&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;extract&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&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;// → [] — nothing. Zero methods.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;pdf-lib 1.17.1 exposes 46 methods on &lt;code&gt;PDFDocument.prototype&lt;/code&gt;, and not one of them mentions text or extraction. It can load a document, copy pages between documents, draw new text onto a page, and save the result. Reading the text already &lt;em&gt;in&lt;/em&gt; a page is simply not in its vocabulary. That is a design boundary, not a missing feature: pdf-lib is a document &lt;em&gt;builder&lt;/em&gt;, and extraction belongs to a document &lt;em&gt;reader&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What pdf.js actually does with your file
&lt;/h2&gt;

&lt;p&gt;A PDF does not store text the way a &lt;code&gt;.txt&lt;/code&gt; file does. It stores positioned fragments — a string here, a string there, each with coordinates — and the order those fragments sit in the file is not necessarily the order a person reads them. pdf.js, Mozilla's open-source PDF parser, parses that structure and hands you the fragments per 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="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageNumber&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="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTextContent&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;getTextContent()&lt;/code&gt; returns one entry per text fragment, each with a &lt;code&gt;str&lt;/code&gt; property. Join them and you have the page's words — the entire extraction step. Everything else in a real tool is interface: file picker, progress label, copy button, download-as-&lt;code&gt;.txt&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;Two things worth knowing before you trust the output blindly. First, the join matters: the example joins fragments with a space, which is what my link extractor does. Nutrient's guide improves on this by checking each item's &lt;code&gt;hasEOL&lt;/code&gt; flag and inserting a newline where the PDF ends a line — better for prose, where a space-join can glue a heading to the next paragraph. Second, pdf.js reads the text &lt;em&gt;layer&lt;/em&gt;. A scanned PDF is pictures, not text, and &lt;code&gt;getTextContent()&lt;/code&gt; will honestly return nothing for those pages. That is the boundary between extraction and OCR — a different tool (Tesseract.js) for a different problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same code, already running in production
&lt;/h2&gt;

&lt;p&gt;This is live code from &lt;a href="https://toolnest-xi-silk.vercel.app/" rel="noopener noreferrer"&gt;ToolNest&lt;/a&gt;'s &lt;a href="https://toolnest-xi-silk.vercel.app/tools/pdf-link-extractor/" rel="noopener noreferrer"&gt;PDF link extractor&lt;/a&gt;, running pdf.js in visitors' browsers — same library, same version, same pattern:&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="no"&gt;PDFJS_URLS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s2"&gt;"https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.min.js"&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="no"&gt;PDFJS_WORKER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.worker.min.js"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details in there earned their place the hard way. The library loads from jsDelivr first and falls back to unpkg if the first CDN fails. And the worker script is pinned to the &lt;em&gt;same&lt;/em&gt; version as the main script, because a version mismatch fails silently — the document just never loads.&lt;/p&gt;

&lt;p&gt;The extraction loop is the heart of the tool, and it is also where the link extractor gets its text to scan:&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="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pdfjsLib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDocument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&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="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;promise&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numPages&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;p&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...annotations checked first...&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTextContent&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&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="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...text scanned for URLs...&lt;/span&gt;
  &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cleanup&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice what it does &lt;em&gt;not&lt;/em&gt; do: the file bytes come from &lt;code&gt;file.arrayBuffer()&lt;/code&gt; — the file the visitor picked, read locally. No upload, no endpoint, no server anywhere in the path. The browser parses the PDF in a Web Worker, and closing the tab leaves nothing behind — a contract never has to trust anyone's retention policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  I ran it on two real PDFs — here are the numbers
&lt;/h2&gt;

&lt;p&gt;I ran the same library version (pdfjs-dist 3.11.174) against two real files from my own site — Pagelyra's free sample PDFs. Test script: &lt;code&gt;/tmp/pdftext-test/extract-test.js&lt;/code&gt;, Node v24.22.1, 2026-11-26, after &lt;code&gt;npm install pdfjs-dist@3.11.174 pdf-lib&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Pages&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Text recovered&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;reading-journal-sample.pdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;4,879 bytes&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;184 ms&lt;/td&gt;
&lt;td&gt;1,328 characters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;clockwork-garden-chapter-1.pdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5,819 bytes&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;15 ms&lt;/td&gt;
&lt;td&gt;5,352 characters&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The journal sample is mostly form labels, returned exactly, blank lines included as &lt;code&gt;__________&lt;/code&gt; underscores. The chapter sample is prose, back in reading order, dialogue quotes intact: &lt;em&gt;"Who is it for, Gran? The key." "Whoever the garden chooses."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Two honest notes. The 184 ms includes the library warming up — the second file took 15 ms, the honest per-file cost once loaded. Node also printed warnings about missing standard font data; they did not affect the output, and they are a Node-only artifact. The point is not the milliseconds: a four-page PDF gives up its text in well under a second, with no server, on a library version already proven in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things that will still bite you
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Scanned PDFs return nothing.&lt;/strong&gt; If the page is a photograph of a page, there is no text layer, and &lt;code&gt;getTextContent()&lt;/code&gt; returns an empty list. Say so in your UI — "no text found, this looks like a scanned document" — instead of showing a blank box and letting the user assume the tool is broken.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reading order is not guaranteed.&lt;/strong&gt; pdf.js returns fragments in the order they sit in the file, which for multi-column layouts can mean the left column's second paragraph arrives after the right column's first. Single-column documents read correctly, as the two test files show. For two-column papers, expect interleaving — sort fragments by coordinates before joining.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The worker setup has two silent failure modes.&lt;/strong&gt; If you forget to set &lt;code&gt;workerSrc&lt;/code&gt;, pdf.js falls back to a "fake worker" on the main thread — extraction still works, but a 50-page PDF freezes the page while it parses. And if the worker version does not match the main library version, loading hangs with no error at all. Both are documented in the w3tweaks guide on PDF.js extraction — pin both scripts to one version string, as the production code does.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can pdf-lib extract text from a PDF?&lt;/strong&gt;&lt;br&gt;
No. I verified it directly: pdf-lib 1.17.1's &lt;code&gt;PDFDocument&lt;/code&gt; has 46 prototype methods and none of them reads text. pdf-lib builds and modifies PDFs; extraction is pdf.js's job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does this work on scanned PDFs?&lt;/strong&gt;&lt;br&gt;
No — a scan has no text layer to read, so &lt;code&gt;getTextContent()&lt;/code&gt; returns nothing for those pages. Scanned documents need OCR (Tesseract.js runs in the browser). Check whether you can select text in your PDF reader first: if you can select it, pdf.js can extract it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How large a PDF can the browser handle?&lt;/strong&gt;&lt;br&gt;
No hard limit, but the whole file sits in memory, and a 5 MB PDF can expand well beyond its file size once parsed. Ordinary documents run in milliseconds, as the test above shows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is my file uploaded anywhere?&lt;/strong&gt;&lt;br&gt;
No. The file is read with &lt;code&gt;file.arrayBuffer()&lt;/code&gt;, parsed by pdf.js in a Web Worker, and the text is produced in your tab. There is no server endpoint involved at all — the entire reason to build it this way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;p&gt;PDF to text in the browser is a solved problem, but only if you pick the reading library: pdf.js, &lt;code&gt;getDocument()&lt;/code&gt; then &lt;code&gt;getTextContent()&lt;/code&gt; per page, worker pinned to the same version. pdf-lib is the wrong tool for this half of the job — and knowing that saves you the afternoon I spent learning it.&lt;/p&gt;

&lt;p&gt;ToolNest's PDF link extractor already runs this exact code in production — it reads the same text layer to find URLs — and the &lt;a href="https://dev.to/shayanali/merging-pdfs-without-uploading-them-how-pdf-lib-runs-entirely-in-your-browser-25p1"&gt;PDF merger from my earlier post&lt;/a&gt; covers the other half with pdf-lib. Between the two libraries, the browser does the whole job, and your file never leaves your machine.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>pdf</category>
      <category>opensource</category>
    </item>
    <item>
      <title>One Copied Helper Broke File Pickers on 85 Pages — the Live FileList Race</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Tue, 17 Nov 2026 14:17:52 +0000</pubDate>
      <link>https://dev.to/shayanali/one-copied-helper-broke-file-pickers-on-85-pages-the-live-filelist-race-53on</link>
      <guid>https://dev.to/shayanali/one-copied-helper-broke-file-pickers-on-85-pages-the-live-filelist-race-53on</guid>
      <description>&lt;p&gt;&lt;em&gt;The file picker did nothing. Drag-and-drop worked fine, on the same pages, through the same helper. That asymmetry was the whole clue.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The reports came in one tool at a time. Click the upload area, pick a file, nothing happens. No error, no console noise, no half-loaded state — just nothing. And on the very same pages, dragging the same file onto the same upload area worked perfectly. Same helper, same pages, two behaviors. When the same code fails one way and works another, the difference between the two paths is the bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  The helper
&lt;/h2&gt;

&lt;p&gt;ToolNest is 146 free tools, all client-side, and the upload tools share one small helper, copied into each page. It wires a drop zone and a hidden file input to the same callback:&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;function&lt;/span&gt; &lt;span class="nf"&gt;wireDropzone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;onFiles&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;dz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"click"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&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="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;click&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="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;dz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"drop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&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="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataTransfer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;onFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataTransfer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;files&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="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"change"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&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="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;picked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&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="n"&gt;picked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;onFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;picked&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="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the fixed version, verbatim from the live source. The &lt;code&gt;change&lt;/code&gt; handler snapshots the files into a plain array &lt;em&gt;before&lt;/em&gt; clearing the input. The old version did it the other way round: it passed the live &lt;code&gt;input.files&lt;/code&gt; straight to the handler, and then cleared &lt;code&gt;input.value&lt;/code&gt; — and the handler was async.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why that order breaks everything
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;FileList&lt;/code&gt; is a live object. It is not a snapshot of the files you picked; it is a view onto the input's current selection. When you set &lt;code&gt;input.value = ""&lt;/code&gt;, the browser resets the selection — and every reference to that &lt;code&gt;FileList&lt;/code&gt;, including the one you just handed to your handler, now reports a length of zero. The files are not deleted. The view is just empty, because the selection it views no longer exists.&lt;/p&gt;

&lt;p&gt;Now add &lt;code&gt;async&lt;/code&gt;. The handler awaits something — a library loading, a file being read — and the &lt;code&gt;await&lt;/code&gt; yields control. The clear has already run synchronously, right after the handler was invoked. When the handler resumes and reaches for &lt;code&gt;files[0]&lt;/code&gt;, the list is empty. No exception is thrown. An empty list is a perfectly valid list, so the handler runs its "no files" path and does nothing, silently. That silence is why the bug survived: nothing in the console, nothing on the page, just a picker that appears dead.&lt;/p&gt;

&lt;p&gt;And that is exactly why drag-and-drop kept working. The &lt;code&gt;drop&lt;/code&gt; branch passes &lt;code&gt;e.dataTransfer.files&lt;/code&gt; — a &lt;code&gt;FileList&lt;/code&gt; from the drop event, not from the input. Clearing &lt;code&gt;input.value&lt;/code&gt; does not touch it, because it was never the input's list. Two branches, two different &lt;code&gt;FileList&lt;/code&gt; provenances, one shared clear. The picker failed; the drop sailed through. If you only ever tested drag-and-drop, the bug was invisible.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it was found
&lt;/h2&gt;

&lt;p&gt;It was not found by a page-load check. Every affected page loaded fine, returned 200, rendered correctly, and showed a working-looking upload area. It was found by an audit that operated every control with real inputs: pick a real file through the picker, watch what happens, assert the outcome. The picker path failed on every upload tool that used the helper. The drop path worked on all of them. That split pointed straight at the helper, and the helper pointed straight at the ordering.&lt;/p&gt;

&lt;p&gt;The fix was one line in each copy — snapshot before clearing — applied across all 85 definitions of the helper in the tree. Verification was the same method as discovery: drive the picker with real files on every upload tool, confirm the files arrive, and grep the whole tree to confirm zero remaining live-&lt;code&gt;FileList&lt;/code&gt; passes. The locale pages needed no fix — the helper appears in only four text-to-speech pages there, already in the fixed pattern and never called, and the 104 locale tool pages have no file inputs at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule, generalized
&lt;/h2&gt;

&lt;p&gt;Snapshot before you clear. Any time a handler is async, treat every live DOM collection it touches as borrowed, not owned: &lt;code&gt;FileList&lt;/code&gt;, &lt;code&gt;HTMLCollection&lt;/code&gt;, &lt;code&gt;NodeList&lt;/code&gt; from the live query methods. Copy what you need into a plain array first, synchronously, and then do whatever cleanup you 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="c1"&gt;// Snapshot first — a plain array is yours, a FileList is on loan.&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;picked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&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="n"&gt;picked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;onFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;picked&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;[...input.files]&lt;/code&gt; does the same job. The reverse direction — building a &lt;code&gt;FileList&lt;/code&gt; to hand back to an input — goes through &lt;code&gt;DataTransfer&lt;/code&gt;, which is the only sanctioned way to construct one. But for reading, the array snapshot is the whole fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  The deeper lesson
&lt;/h2&gt;

&lt;p&gt;Eighty-five copies of one helper means eighty-five copies of one bug. A helper that lives in one place, imported once, turns this story into a one-line fix with one verification. A helper copied into every page turns it into a fleet-wide patch with a fleet-wide audit. Copy-paste is a distribution mechanism for defects, and the more useful the helper, the wider the distribution.&lt;/p&gt;

&lt;p&gt;The other lesson is about what counts as a check. A page that loads, renders, and shows the right title can still have a dead upload button, a calculator that never computes, or a search that matches nothing. The audit that found this bug — and a second one the same day, a search that matched whole queries as single substrings and returned nothing for multi-word phrases — operated every button, input, and form with real inputs and asserted the real outcome. Page-load checks are not an audit. Operating the thing is the audit.&lt;/p&gt;

&lt;p&gt;The tools are at &lt;a href="https://toolnest-xi-silk.vercel.app" rel="noopener noreferrer"&gt;ToolNest&lt;/a&gt;, and the page where the helper above lives is the &lt;a href="https://toolnest-xi-silk.vercel.app/tools/pdf-merger/" rel="noopener noreferrer"&gt;PDF merger&lt;/a&gt; — picker, drop zone, and all. If you have a file input anywhere in your own code, go read its &lt;code&gt;change&lt;/code&gt; handler. If it passes &lt;code&gt;input.files&lt;/code&gt; to anything async and clears the input afterwards, you have this bug. Snapshot first.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>debugging</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Is This Open-Source AI Project Still Alive? A 5-Minute GitHub Check Before You Self-Host It</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Sat, 14 Nov 2026 10:15:43 +0000</pubDate>
      <link>https://dev.to/shayanali/is-this-open-source-ai-project-still-alive-a-5-minute-github-check-before-you-self-host-it-3jin</link>
      <guid>https://dev.to/shayanali/is-this-open-source-ai-project-still-alive-a-5-minute-github-check-before-you-self-host-it-3jin</guid>
      <description>&lt;p&gt;I maintain a catalogue of open-source AI projects — 2,155 of them, across 17 categories — and the question I get asked most is not "which tool should I use?" It's "how do I know this project won't be abandoned six months after I build on it?"&lt;/p&gt;

&lt;p&gt;Stars won't tell you. A repository with 40,000 stars can sit untouched for two years. What follows is the five-minute check I actually run, using nothing but the GitHub website. No API keys, no command line.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The last commit date — but read it properly
&lt;/h2&gt;

&lt;p&gt;Open the repo. Right there on the file list, next to the top file, is the last commit's timestamp. That is your first signal, and it's a blunt one: a last commit from over a year ago is close to a verdict on its own.&lt;/p&gt;

&lt;p&gt;But a commit from this week means almost nothing by itself. It could be a typo fix, a README tweak, or a bot bumping a dependency. So the date is a filter, not a pass mark. If it's old, stop here. If it's recent, keep going.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The shape of the commit graph, not the volume
&lt;/h2&gt;

&lt;p&gt;Go to Insights → Contributors, then the commit history. What you want is cadence, not volume: a repo that gets a cluster of commits every few weeks is healthier than one that had a single burst of activity a year ago and nothing since. Look at the graph over the last year, not the last month — a healthy project has a rhythm, even if it's a slow one.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Releases tell you about discipline
&lt;/h2&gt;

&lt;p&gt;Click Releases in the right sidebar. Two things matter: interval and honesty. Are releases coming out on some rhythm, or was the last tagged release years ago while commits keep landing on main? A project that tags releases is a project whose maintainers think about the people installing it, not just the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Open issues: the number lies, the trend doesn't
&lt;/h2&gt;

&lt;p&gt;Everyone glances at the open-issue count and panics. Ignore the absolute number — a popular project always has hundreds. What matters is the ratio and the response time. Sort issues by "Recently updated" and "Newly created", then ask: are maintainers replying within a day or two, or have threads sat ignored for months? Use the search filter &lt;code&gt;is:issue is:closed sort:updated-desc&lt;/code&gt; to see whether things actually get closed or just accumulate. A repo with thousands of open issues where maintainers still reply quickly is far more alive than one with a handful of issues that have all sat ignored for months.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Bus factor: the question that actually bites
&lt;/h2&gt;

&lt;p&gt;Open Insights → Contributors and look at the distribution. If one person authored the overwhelming majority of commits and everyone else only fixed a typo, you have a bus factor of one: the project lives and dies with one human's free time, mood, and job situation. I don't treat single-maintainer projects as automatically disqualified — some are excellent and stable — but I do treat them differently. For anything I depend on, I want to see at least a few people who can merge, release, and answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The licence and the archived flag
&lt;/h2&gt;

&lt;p&gt;Check the licence GitHub detected (MIT, Apache 2.0, AGPL — or nothing at all). "No licence" means you technically have no permission to use the code, whatever the README implies. And check the archived banner: an archived repository is read-only by its maintainers. It will receive no further updates, bug fixes, or security patches. Archived means done, full stop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example: two repos, checked today
&lt;/h2&gt;

&lt;p&gt;I ran this check this morning (14 November 2026) on two projects from our catalogue, using the public GitHub API record as the source of truth:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ollama&lt;/strong&gt; (ollama/ollama) — 186,928 stars, last push today, 4,656 open issues, MIT licence, 19,080 forks, not archived. A big open-issue count on a project this size is normal; what matters is that pushes and releases keep landing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;llama.cpp&lt;/strong&gt; (ggml-org/llama.cpp) — 134,954 stars, last push today, 2,606 open issues, MIT licence, 25,589 forks, not archived. Same picture: heavy traffic, steady maintenance, broad contributor base.&lt;/p&gt;

&lt;p&gt;Both pass in under a minute each. The check isn't the hard part — remembering to run it before you install is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one exception: stable is not dead
&lt;/h2&gt;

&lt;p&gt;A quiet repo can be finished, not abandoned. A small tool with no open bugs, a README that says "complete", and a maintainer who closes issues promptly has nothing left to commit — and that's fine. The signals that separate "finished" from "dead": closed issues with real answers, tagged releases, and a README that states the project's status honestly. If a repo's last commit is two years old and its issue tracker is a graveyard of unanswered questions, that's dead. If its last commit is two years old and there's simply nothing left to fix, that's done — and done is a perfectly good thing to self-host.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routine, in one paragraph
&lt;/h2&gt;

&lt;p&gt;Last commit date first. Then the shape of the commit graph over a year. Then release rhythm, issue response times, contributor spread, and the licence. Five minutes, six signals, no tools beyond the browser. Run it before you self-host anything you expect to still be running next year — the download you skip is the fastest one.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;All repo figures checked 14 November 2026 against the projects' own GitHub records. LibreAI's catalogue — 2,155 open-source AI projects with licence, stars and activity checked — is at &lt;a href="https://libreaihub.com/open-source-ai-statistics/" rel="noopener noreferrer"&gt;https://libreaihub.com/open-source-ai-statistics/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>webdev</category>
      <category>github</category>
    </item>
    <item>
      <title>Merging PDFs without uploading them: how pdf-lib runs entirely in your browser</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Fri, 13 Nov 2026 10:09:22 +0000</pubDate>
      <link>https://dev.to/shayanali/merging-pdfs-without-uploading-them-how-pdf-lib-runs-entirely-in-your-browser-25p1</link>
      <guid>https://dev.to/shayanali/merging-pdfs-without-uploading-them-how-pdf-lib-runs-entirely-in-your-browser-25p1</guid>
      <description>&lt;h1&gt;
  
  
  Merging PDFs without uploading them: how pdf-lib runs entirely in your browser
&lt;/h1&gt;

&lt;p&gt;Yesterday I answered a question about merging PDFs for free without a watermark, and the most common follow-up was: "free, sure — but where does my file go?" It's a fair question. Most free PDF tools upload your document to a server, merge it there, and hand it back. Your file — a contract, a payslip, a visa application — sits on infrastructure you don't control, for as long as their retention policy says.&lt;/p&gt;

&lt;p&gt;There is a different way to build the same tool, and it's not even hard. The library is pdf-lib, it runs entirely in the browser, and the whole merge is about thirty lines of code. Here's how it works, what it can't do, and why I built ToolNest's PDF tools this way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea in one paragraph
&lt;/h2&gt;

&lt;p&gt;A PDF is a structured document, not a picture. pdf-lib parses that structure in JavaScript, lets you copy pages from several documents into one new document, and serialises the result back to bytes — all in memory, in your tab. No upload happens because there is no server endpoint to upload to. The browser does the work; the file never leaves the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;

&lt;p&gt;The core is small enough to read in full:&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="nc"&gt;PDFDocument&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'pdf-lib'&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;mergePdfs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&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="n"&gt;merged&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;PDFDocument&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&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;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;files&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="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;src&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;PDFDocument&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="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;ignoreEncryption&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="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="n"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;merged&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;copyPages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPageIndices&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="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;merged&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&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="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;mergedBytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;merged&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&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;return&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mergedBytes&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="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/pdf'&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wire that to a file input and a download link and you have a working merger:&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="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'change'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="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="n"&gt;blob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;mergePdfs&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="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;files&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&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="n"&gt;blob&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="n"&gt;a&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="s1"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;download&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'merged.pdf'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;click&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="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;revokeObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&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="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;That's the whole product. Everything else — drag to reorder pages, a page-range picker, a progress indicator — is interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it handles well
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ordinary merges.&lt;/strong&gt; Two or three PDFs into one, in the order you choose. This covers the vast majority of real use: application packs, scanned forms, a contract plus its annexes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Page ranges.&lt;/strong&gt; &lt;code&gt;copyPages&lt;/code&gt; takes an index list, so "pages 2–4 of this file, all of that one" is one line, not a separate feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Form fields and links.&lt;/strong&gt; Copied pages keep their annotations. A merged contract still has its clickable links, which is the detail that separates a real merge from screenshotting pages into a new file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The honest limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encrypted PDFs.&lt;/strong&gt; A password-protected file needs its password before pdf-lib can open it. &lt;code&gt;ignoreEncryption: true&lt;/code&gt; lets the load proceed in some cases, but a file that genuinely requires a password will fail until you supply it — and the password, like the file, is typed into your own browser, not sent anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Very large files.&lt;/strong&gt; Everything happens in memory. Merging a dozen 100MB scans on a phone will be slow and may run out of memory. For that scale, a local desktop tool is the right answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scanned image PDFs.&lt;/strong&gt; pdf-lib copies pages; it doesn't OCR them. A scanned document merges fine, but it stays a picture of text until you run OCR separately.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this matters beyond PDFs
&lt;/h2&gt;

&lt;p&gt;The same pattern — a capable library, WebAssembly or plain JavaScript, everything local — is how ToolNest's background remover, image converter and file tools work too. The architecture choice is the product: when a tool runs on your machine, it can't change price, change terms, or close on three weeks' notice. remove.bg's standalone site closes on 1 December 2026; a browser-based tool has no standalone site to close.&lt;/p&gt;

&lt;p&gt;There is a trade-off, and it's worth naming. A server can throw a GPU at a hard problem; a browser has whatever your device has. For merging PDFs the browser is more than enough, which is why this is one of the easiest tools to build honestly: free, no account, no upload, no watermark, no retention policy to read.&lt;/p&gt;

&lt;p&gt;If you want to try the finished version rather than build it, ToolNest's PDF merger is at &lt;a href="https://toolnest-xi-silk.vercel.app/tools/pdf-merger/" rel="noopener noreferrer"&gt;https://toolnest-xi-silk.vercel.app/tools/pdf-merger/&lt;/a&gt; — open it, drop in your files, download the result. And if you build your own, start with the thirty lines above. They're the whole trick.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>pdf</category>
    </item>
    <item>
      <title>How background removal works entirely in your browser (and why it matters for your photos)</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Thu, 12 Nov 2026 10:10:43 +0000</pubDate>
      <link>https://dev.to/shayanali/how-background-removal-works-entirely-in-your-browser-and-why-it-matters-for-your-photos-2o12</link>
      <guid>https://dev.to/shayanali/how-background-removal-works-entirely-in-your-browser-and-why-it-matters-for-your-photos-2o12</guid>
      <description>&lt;h1&gt;
  
  
  How background removal works entirely in your browser (and why it matters for your photos)
&lt;/h1&gt;

&lt;p&gt;Yesterday's news — remove.bg closing its standalone site on 1 December 2026 — sent a lot of people looking for a replacement. Most of the lists you'll find point at another upload-and-wait service. But there is a different kind of replacement, and it's worth understanding: a background remover that runs entirely in your browser, where your photo never leaves your device.&lt;/p&gt;

&lt;p&gt;I built one (it's part of ToolNest), and building it taught me how the whole thing actually works under the hood. Here's the honest version — what the browser is really doing, where it struggles, and when you should use something else instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "in-browser" actually means
&lt;/h2&gt;

&lt;p&gt;A normal online background remover works like this: you upload a photo to a server, a model on that server finds the subject, and you download the result. Your photo travels to a stranger's infrastructure and, depending on their retention policy, may sit there for hours or days.&lt;/p&gt;

&lt;p&gt;A browser-based remover flips the pipeline around. The model — a small segmentation network, usually a U-Net-style architecture trained to separate foreground from background — is downloaded once as a compact file (a few megabytes, often running through ONNX Runtime Web or TensorFlow.js) and then executes locally, in your tab, using WebAssembly or WebGL. Your photo goes from your disk, into your browser's memory, through the model, and back out as a PNG with transparency. Nothing is uploaded, because there is nothing to upload to.&lt;/p&gt;

&lt;p&gt;That distinction is the whole product. Speed is a bonus; privacy is the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline, step by step
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load and downscale.&lt;/strong&gt; The model doesn't need your 24-megapixel photo. It works on a downscaled copy (typically 320×320 or 512×512) — enough resolution to find edges, small enough to run in milliseconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segment.&lt;/strong&gt; The model outputs a mask: for every pixel, a probability that it belongs to the foreground. This is the expensive step, and it's the one that used to need a GPU server. Modern browsers do it on your CPU or integrated GPU in under a second for a typical photo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refine the mask.&lt;/strong&gt; A raw mask has soft, noisy edges. A quick refinement pass — feathering, morphological cleanup, sometimes a guided filter using the original image — turns a blobby outline into something that looks cut out rather than torn out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composite.&lt;/strong&gt; The refined mask becomes the alpha channel of your original full-resolution photo. The subject keeps every original pixel; only the background becomes transparent.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Where it struggles (the honest limits)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hair, fur and translucent edges.&lt;/strong&gt; This is where every remover — free or paid, browser or server — fails first. A mask at 320×320 simply cannot resolve individual hairs. Good tools feather the edge so it looks natural at normal zoom; great tools let you paint the mask back in by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Busy backgrounds.&lt;/strong&gt; If the background has the same colours and textures as the subject, the model has to guess. A clean, well-lit photo with a contrasting background gives the best result by a wide margin — which is also why product photographers use plain backdrops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One photo at a time.&lt;/strong&gt; The browser is doing real work per image. If you need 200 product shots processed in an afternoon, a scripted local workflow (open-source rembg on your own machine, for example) is the right tool — and it's free too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Big files, slow devices.&lt;/strong&gt; A 50MB photo on a five-year-old phone will take its time. Downscaling helps, but there's no escaping the compute.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to use which kind
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One photo, personal or client work:&lt;/strong&gt; browser-based. No upload, no account, no credits, no retention policy to read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A batch of product shots:&lt;/strong&gt; local script (rembg) or a desktop app. Same privacy, far more throughput.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A hard edge case (wedding hair, glass, fur):&lt;/strong&gt; a desktop editor with manual masking, or a paid service — and check what happens to your file afterwards.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I built it this way
&lt;/h2&gt;

&lt;p&gt;ToolNest is 144 free tools, and every one of them runs client-side. That started as an architecture preference and became the product's entire promise: your salary after tax, your weight, your client's product photos are not a website's business. Close the tab and the numbers are gone, because they were never anywhere else.&lt;/p&gt;

&lt;p&gt;remove.bg closing is a reminder of why that matters: when a free service is someone else's server, it can change price, change terms, or close on three weeks' notice. A tool that runs on your own machine can't be taken away on a deadline.&lt;/p&gt;

&lt;p&gt;The background remover is at &lt;a href="https://toolnest-xi-silk.vercel.app/tools/background-remover/" rel="noopener noreferrer"&gt;https://toolnest-xi-silk.vercel.app/tools/background-remover/&lt;/a&gt; — open it, drop a photo in, download the result. Try it on your hardest image first, zoom in on the edges, and tell me where it fails. That's how all 144 tools got built, one demand at a time.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>design</category>
    </item>
    <item>
      <title>remove.bg is closing on 1 December. Here's a free alternative that runs in your browser</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Wed, 11 Nov 2026 10:10:16 +0000</pubDate>
      <link>https://dev.to/shayanali/removebg-is-closing-on-1-december-heres-a-free-alternative-that-runs-in-your-browser-1a8j</link>
      <guid>https://dev.to/shayanali/removebg-is-closing-on-1-december-heres-a-free-alternative-that-runs-in-your-browser-1a8j</guid>
      <description>&lt;p&gt;remove.bg — the background remover most of us have used at least once — is closing its standalone website on 1 December 2026 at 9:00am CET. Its own FAQ says so plainly: background removal moves into Canva, unused pay-as-you-go credits expire the same day, and the self-serve API stops (it moves to Leonardo.ai; existing Enterprise API contracts continue).&lt;/p&gt;

&lt;p&gt;If you remove backgrounds for product photos, thumbnails, profile pictures or slides, that date matters. Here's what actually changes, and what to use instead — free, without uploading your photos to anyone's server.&lt;/p&gt;

&lt;h2&gt;
  
  
  What exactly is ending
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The remove.bg website closes on 1 December 2026.&lt;/strong&gt; The standalone service is gone; the feature lives on inside Canva.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unused PAYG credits expire the same day.&lt;/strong&gt; If you have a balance, use it or lose it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The self-serve API stops.&lt;/strong&gt; It moves to Leonardo.ai (also Canva-owned). Enterprise API contracts continue as they are.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inside Canva, single-photo removal worked on a free account&lt;/strong&gt; in a competitor's test on 7 November 2026 — but bulk removal needs a paid plan. So the free route survives for one photo at a time; anyone processing batches of product shots is now paying.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is a surprise if you watched the direction of travel — remove.bg was acquired by Canva, and consolidation was always the likely ending. But the deadline is real, and 1 December is three weeks away.&lt;/p&gt;

&lt;h2&gt;
  
  
  The free alternative I built: ToolNest's background remover
&lt;/h2&gt;

&lt;p&gt;I run ToolNest — 136 free tools, all client-side. One of them is a background remover, and it's the honest replacement for the remove.bg workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free, no account, no credits.&lt;/strong&gt; Nothing to buy, no usage counter ticking down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your photo never leaves your device.&lt;/strong&gt; The removal runs entirely in your browser. For product photos, ID shots and client work, that matters — you're not uploading someone else's images to a stranger's server and hoping their retention policy is honest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No batch limit to hit.&lt;/strong&gt; One photo or fifty, the tool doesn't care.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's at &lt;a href="https://toolnest-xi-silk.vercel.app/tools/background-remover/" rel="noopener noreferrer"&gt;https://toolnest-xi-silk.vercel.app/tools/background-remover/&lt;/a&gt; — open it, drop a photo in, download the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest limits (because every free tool has them)
&lt;/h2&gt;

&lt;p&gt;A browser-based remover is not magic, and I'd rather tell you the limits than have you discover them mid-deadline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complex edges are harder.&lt;/strong&gt; Hair, fur and fine translucent edges are where every remover — free or paid — struggles most. A clean, well-lit photo with a contrasting background gives the best result; a busy background gives the worst.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's one photo at a time in the browser.&lt;/strong&gt; If you need to process 200 product shots in an afternoon, a scripted local workflow (open-source rembg on your own machine, for example) is the right tool for that job — and it's free too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the result before you ship it.&lt;/strong&gt; Zoom in on the edges. A two-second look catches the one stray pixel that makes a product photo look amateur.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These limits are the same ones remove.bg's free tier had. The difference is only who holds your photo while the work happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do before 1 December
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use up any remove.bg PAYG credits&lt;/strong&gt; — they expire on the deadline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you rely on the API&lt;/strong&gt;, check whether your usage moves to Leonardo.ai or whether an Enterprise contract covers you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Try the free alternative on a real photo now&lt;/strong&gt;, not on 30 November. Test it on your hardest image — the one with messy hair or a cluttered background — and see whether the result is good enough for your work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you sell products online&lt;/strong&gt;, the same week is a good moment to sort your photo workflow generally: consistent lighting and a plain background make every remover — free or paid — dramatically better.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why I built it client-side
&lt;/h2&gt;

&lt;p&gt;The whole point of ToolNest is that the tools run in your browser: no server receiving your data, because there's nothing for the calculation to phone home to. That started as an architecture preference and became the product's entire promise — your salary after tax, your weight, your client's product photos are not a website's business. Close the tab and the numbers are gone, because they were never anywhere else.&lt;/p&gt;

&lt;p&gt;remove.bg closing is a reminder of why that matters: when a free service is someone else's server, it can change price, change terms, or close on three weeks' notice. A tool that runs on your own machine can't be taken away on a deadline.&lt;/p&gt;

&lt;p&gt;Try the background remover, tell me where it fails on your photos, and I'll keep improving it — that's how all 136 tools got built, one demand at a time.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>javascript</category>
      <category>design</category>
    </item>
    <item>
      <title>A competitor with 16 tools gets 730 clicks a day. Here's what I learned from it</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Tue, 10 Nov 2026 10:25:02 +0000</pubDate>
      <link>https://dev.to/shayanali/a-competitor-with-16-tools-gets-730-clicks-a-day-heres-what-i-learned-from-it-4c17</link>
      <guid>https://dev.to/shayanali/a-competitor-with-16-tools-gets-730-clicks-a-day-heres-what-i-learned-from-it-4c17</guid>
      <description>&lt;p&gt;Last week I studied a direct competitor in the free-tools niche. It has 16 tool pages. It gets roughly 730 clicks a day from Google, at an average position of 4.9. My site has 136 tools and gets a fraction of that. The gap is not the number of tools. It is everything around them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the competitor actually does
&lt;/h2&gt;

&lt;p&gt;The site is small and plain: 24 URLs in its sitemap, 16 tool pages, a policy pack, AdSense and Analytics live. It has no robots.txt. It has no ads.txt. Its tool pages carry no JSON-LD schema. Its BMI page is about 670 words of real content sections — not thin, but not remarkable either.&lt;/p&gt;

&lt;p&gt;And yet it ranks #1–2 for long-tail queries across its tools. Its domain authority is effectively zero. So the rankings are not coming from authority. They are coming from three things I could see:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An aged own domain.&lt;/strong&gt; It is not on a free subdomain. That alone is a ranking signal a subdomain site cannot buy overnight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sitewide footer links.&lt;/strong&gt; Every page links to the tool pages, so every tool page carries internal authority from the whole site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-tail focus, not head terms.&lt;/strong&gt; It does not rank for "BMI calculator". It ranks for the specific, low-competition phrasing people actually type — and it holds those positions across sixteen tools at once.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I changed on my own site the same night
&lt;/h2&gt;

&lt;p&gt;The analysis was only worth doing if it changed something, so it did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A focus pass on the top tools.&lt;/strong&gt; The loan calculator was still branded "Auto Loan Calculator" while the search demand is for "loan calculator" — title, H1, schema and meta now lead with the head query. The currency converter and JSON formatter got the same treatment, and six tool pages had their meta descriptions trimmed under 150 characters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sitewide footer links.&lt;/strong&gt; The top 15 tools are now linked from the footer of 250 English pages — the same internal-linking shape the competitor uses, applied at our scale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The gap tools, built.&lt;/strong&gt; The competitor had two tools we did not: a negative-marks calculator and a timetable maker, both serving real student demand in India. The negative-marks calculator is built, math-tested and live; the timetable maker is queued. The point is not copying the competitor — it is not leaving a demand gap open when the evidence shows people searching for it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The lesson that matters
&lt;/h2&gt;

&lt;p&gt;Tool count is a vanity metric. Sixteen tools, each ranking #1–2 for its long tail, beat 136 tools that mostly sit unranked. The work that moves traffic is unglamorous: the right title on the right page, internal links that actually distribute authority, and closing the specific demand gaps competitors already proved exist.&lt;/p&gt;

&lt;p&gt;I spent months building tools. The next phase is making the tools findable — one focused page at a time.&lt;/p&gt;

&lt;p&gt;The site is ToolNest — &lt;a href="https://toolnest-xi-silk.vercel.app" rel="noopener noreferrer"&gt;https://toolnest-xi-silk.vercel.app&lt;/a&gt; — 136 free tools, no sign-ups, everything running in your browser.&lt;/p&gt;

</description>
      <category>marketing</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>seo</category>
    </item>
    <item>
      <title>Shipping 134 tools with zero backend: the static-site architecture behind ToolNest</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:12:06 +0000</pubDate>
      <link>https://dev.to/shayanali/shipping-134-tools-with-zero-backend-the-static-site-architecture-behind-toolnest-5ce4</link>
      <guid>https://dev.to/shayanali/shipping-134-tools-with-zero-backend-the-static-site-architecture-behind-toolnest-5ce4</guid>
      <description>&lt;p&gt;ToolNest is 134 free tools — calculators, converters, PDF utilities, developer helpers — and there is no backend behind any of them. No server, no database, no API, no accounts. Every tool runs entirely in the visitor's browser. Here's the architecture that makes that possible, and what it costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  One page per tool, generated not hand-written
&lt;/h2&gt;

&lt;p&gt;134 hand-written HTML pages would be unmaintainable, so the site is generated: a single build script turns a tool registry (name, category, inputs, formula, copy) into static pages. Adding a tool means adding one registry entry and rebuilding. The generated pages share one layout, one stylesheet and one script bundle, which is why the whole site feels consistent despite its size — consistency is a build property, not a discipline problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Client-side everything, by design
&lt;/h2&gt;

&lt;p&gt;Every calculation happens in JavaScript on the page. That started as a simplicity choice and became the product's core promise: your salary, your weight, your PDF never leaves your device, because there is nothing for it to phone home to. The trade-off is real — anything that needs a server (live exchange rates, file storage, accounts) simply doesn't exist on ToolNest, and some tools are less powerful than their server-backed rivals. The privacy guarantee is worth more than the missing features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance as a feature, not a metric
&lt;/h2&gt;

&lt;p&gt;A calculator page that takes three seconds to become usable has already failed its user, who arrived mid-task with a deadline. The budget we hold: pages under 100KB of critical resources, no framework, no web fonts on tool pages, scripts deferred. Lighthouse scores stay green not because we chase them, but because a slow calculator is a contradiction — the whole point is the answer, fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Search is the hard part
&lt;/h2&gt;

&lt;p&gt;Static sites give up live search. ToolNest's answer is a generated search index: a small JSON file built at deploy time listing every tool with its keywords, searched client-side as you type. It costs a few kilobytes and zero requests. The same trick covers the sitemap — generated, not computed — which matters when you want 134 pages indexed without a crawler budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  What breaks at this scale
&lt;/h2&gt;

&lt;p&gt;Three things, in practice. First, deploy size: 134 pages plus assets eventually trips hosting upload limits, so the build now splits output and the deploy order is planned, not assumed. Second, consistency drift: a fix applied to one generated page must be applied in the generator, or it silently reverts on the next rebuild — every "quick edit" to a live page is a bug waiting to happen. Third, the registry itself: at 134 entries, a typo in one tool's metadata ships to production unless the build validates every entry before generating — so it does, and the build fails loudly on bad data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest bit
&lt;/h2&gt;

&lt;p&gt;Zero backend is not a virtue in itself; it's a trade. You give up accounts, saved state, live data and server-side anything. What you get back is a site that costs almost nothing to run, loads anywhere, keeps nothing about its visitors, and can be rebuilt from one script on any machine. For a tool that answers a question and gets out of the way, that trade is the right one — 134 times over.&lt;/p&gt;

&lt;p&gt;The site itself is at &lt;a href="https://toolnest-xi-silk.vercel.app" rel="noopener noreferrer"&gt;https://toolnest-xi-silk.vercel.app&lt;/a&gt; — 134 tools, free, no sign-ups, everything in your browser.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>performance</category>
    </item>
    <item>
      <title>Keeping a 2,135-project catalogue fresh with a static site and a weekly script</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Sun, 08 Nov 2026 10:15:54 +0000</pubDate>
      <link>https://dev.to/shayanali/keeping-a-2135-project-catalogue-fresh-with-a-static-site-and-a-weekly-script-3gl2</link>
      <guid>https://dev.to/shayanali/keeping-a-2135-project-catalogue-fresh-with-a-static-site-and-a-weekly-script-3gl2</guid>
      <description>&lt;p&gt;LibreAI is a catalogue of 2,135 open-source AI projects on GitHub, across 17 categories, with a full install guide for 1,138 of them and shorter verified pages for 997 more. There is no database behind it. No CMS, no admin panel, no server-side code at all — just static HTML, rebuilt on a schedule. Here's how the catalogue stays honest without a backend.&lt;/p&gt;

&lt;h2&gt;
  
  
  The weekly pass
&lt;/h2&gt;

&lt;p&gt;Every week, 10–15 new projects are researched and added. Each candidate is verified live against the GitHub API before it ships: stars, forks, licence, and recent activity. A project with real momentum and an active community gets in; a dead repo, a renamed repo, or a licence that doesn't match its README doesn't. The check happens before listing, not after someone complains.&lt;/p&gt;

&lt;p&gt;That cadence matters more than it sounds. Open-source projects move: maintainers rename repos, archive them, change licences, or go quiet for a year. A catalogue that verified everything once, at launch, would be quietly wrong within months. The weekly pass is the whole quality system — small, boring, and non-negotiable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hidden gems, on purpose
&lt;/h2&gt;

&lt;p&gt;997 of the 2,135 projects are "hidden gems": strong, verified projects that nobody has covered yet, on shorter pages for now. They get expanded into full guides over time. The split is deliberate — a short honest page for a good project beats no page at all, and it beats a padded page that pretends to know more than it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why static
&lt;/h2&gt;

&lt;p&gt;No database means no server to babysit, no login system to secure, and pages that load fast anywhere in the world. The trade-off is that every change is a rebuild instead of an edit: fix a guide, regenerate the site, deploy. For a catalogue that changes weekly rather than hourly, that's a good trade. The other trade-off is search — the category pages are searchable, but there's no live query engine; the index is generated, not computed per request.&lt;/p&gt;

&lt;h2&gt;
  
  
  What breaks
&lt;/h2&gt;

&lt;p&gt;Three things, in practice. First, upstream drift: a project's star count doubles, or its maintainer archives it, and the guide goes stale between passes — the weekly verification catches it, but only weekly. Second, category creep: a project that fits two categories has to live in one, and the choice is a judgement call every time. Third, the long tail: the deeper you go into the catalogue, the thinner the signal — a 400-star project with a careful README can matter more than a 40,000-star one coasting on a launch post. Stars sort; they don't judge.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest bit
&lt;/h2&gt;

&lt;p&gt;A catalogue like this is only as good as its last verification pass. That's not a flaw in the design — it's the design. The weekly rhythm exists because "verified once" is a promise no static site can keep, and "verified weekly" is one it can.&lt;/p&gt;

&lt;p&gt;The catalogue itself is at &lt;a href="https://libreaihub.com" rel="noopener noreferrer"&gt;https://libreaihub.com&lt;/a&gt; — 2,135 projects, 17 categories, every one of them free and open source.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building a 2,135-Project Static Showcase (No Database, No Framework, No Regrets)</title>
      <dc:creator>Shayan Ali</dc:creator>
      <pubDate>Fri, 06 Nov 2026 12:11:27 +0000</pubDate>
      <link>https://dev.to/shayanali/building-a-2135-project-static-showcase-no-database-no-framework-no-regrets-32mg</link>
      <guid>https://dev.to/shayanali/building-a-2135-project-static-showcase-no-database-no-framework-no-regrets-32mg</guid>
      <description>&lt;h1&gt;
  
  
  Building a 2,135-Project Static Showcase (No Database, No Framework, No Regrets)
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;How LibreAI — a catalogue of 2,135 verified open-source AI projects with install guides, search and favourites — ships as pure static files.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;LibreAI catalogues 2,135 open-source AI projects across 17 categories. Every project has its own page: what it does, who it's for, key features, an install guide derived from the project's README, alternatives, and an FAQ. The whole thing exists in 7 language editions — roughly 15,000 pages. There is no database, no server-side rendering, and no JavaScript framework. A Python build script generates flat HTML, and a static host serves it.&lt;/p&gt;

&lt;p&gt;This post is about why that architecture won, and what it costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data is code
&lt;/h2&gt;

&lt;p&gt;The catalogue lives in Python data modules — lists of dicts, one per project, concatenated in a fixed order at build time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;REPOS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;REPOS_CORE&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;EXTRA&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;V3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;EXTRA2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;EXTRA11&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each record carries the fields the pages need: name, GitHub URL, category, tagline, description, features, licence, stars, forks, last-push date, the project's own website, alternatives, and — for 1,126 of the projects — a &lt;code&gt;run&lt;/code&gt; block with install steps distilled from the project's README.&lt;/p&gt;

&lt;p&gt;Data-as-code sounds primitive until you list what it buys:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Validation is free.&lt;/strong&gt; A build either renders a record or throws. There is no "row in a weird state" because there are no rows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Derived statistics are trivial.&lt;/strong&gt; Our statistics page (star distributions, licence breakdowns, per-category counts) is computed from the same &lt;code&gt;REPOS&lt;/code&gt; list the pages are built from — one source of truth, zero chance of the stats page disagreeing with the catalogue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diffs are reviewable.&lt;/strong&gt; Adding a weekly batch of projects is a diff in a data file, readable by a human before it ships.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cost is real too: the data files are enormous, and you must never line-edit a generated single-line file by hand. We learned to treat data modules as append-only artefacts with tooling around them, not as documents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification is a pipeline step, not a vibe
&lt;/h2&gt;

&lt;p&gt;Every project in the catalogue was verified against GitHub at intake: the repo exists, the licence is what we say it is, the star/fork counts and last-push date are recorded from the repo itself. Those recorded values are a &lt;em&gt;snapshot&lt;/em&gt;, and the site is honest about that — the statistics page dates itself ("October 2026") and the methodology note explains that "pushed in 2026" is a property of the snapshot, not a live query.&lt;/p&gt;

&lt;p&gt;That honesty is an architectural feature. A static site cannot pretend to be live data; designing around a dated snapshot forces you to say exactly what you know and when you knew it. 96.5% of the snapshot's 2,123 projects (the count at snapshot time; the catalogue has since grown to 2,135) had recorded a push in 2026 — a claim we can only make because the verification step stored the field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generating 15,000 pages without hating your life
&lt;/h2&gt;

&lt;p&gt;The build is one Python program that walks the data and writes files: a page per project per edition, category hubs, the statistics page, sitemaps, feeds. The engineering rules that kept it sane:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One template function, no template engine.&lt;/strong&gt; Pages are built by a handful of Python functions returning strings. Boring, debuggable, and fast enough — a full build is minutes, not a CI event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never regenerate what you can't verify.&lt;/strong&gt; After each build we check the output tree: page counts per edition, sitemap coverage, and spot-checks that a repo page's install guide matches its record. Static generation fails silently in the worst way (a missing page is just… missing), so the checks are part of the build, not an afterthought.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deploys are chunked file uploads, and payloads have hard limits.&lt;/strong&gt; Our deploy route rejects payloads above ~129 KB per file, so the build keeps individual files small and the deployer uploads file-by-file with digests. This constraint quietly improves the site: no giant bundled anything, ever.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The two dynamic features, and how static survived them
&lt;/h2&gt;

&lt;p&gt;A showcase needs favourites and a "request a project" form — the only two genuinely dynamic features. Both live in Supabase: an anonymous-key client talks directly from the browser, with row-level rules doing the guarding. The static pages don't know or care; if Supabase is down, the catalogue still renders perfectly and only the star button sulks. That's the correct failure hierarchy for a content site: reading is the product, interaction is garnish.&lt;/p&gt;

&lt;p&gt;Search is the other obvious question. At 2,135 records, a pre-built static index plus a few kilobytes of vanilla JS beats a search backend on every axis that matters here: latency, cost, and the dignity of not running infrastructure to grep a list.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell someone building a directory today
&lt;/h2&gt;

&lt;p&gt;Start with the data model and the verification step; the pages are the easy part. Publish your methodology and date your snapshots. Compute your marketing statistics from the same data you render, so you can never accidentally lie. And pick the boring stack on purpose: the interesting problem in a directory is &lt;em&gt;coverage and correctness&lt;/em&gt;, and every hour not spent on framework churn is an hour spent verifying the next hundred projects.&lt;/p&gt;

&lt;p&gt;LibreAI is live at libreaihub.vercel.app — 2,135 projects, 17 categories, 1,126 install guides. The statistics page is generated from the catalogue data itself, if you'd like to check the arithmetic behind this post.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>python</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
