<?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: Amit Sahoo</title>
    <description>The latest articles on DEV Community by Amit Sahoo (@connectamitsahoo).</description>
    <link>https://dev.to/connectamitsahoo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2905646%2F724d91e1-c553-4f0d-b67e-647d34b507ed.png</url>
      <title>DEV Community: Amit Sahoo</title>
      <link>https://dev.to/connectamitsahoo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/connectamitsahoo"/>
    <language>en</language>
    <item>
      <title>Introducing Trace.js – A Lightweight jQuery based Text Highlighter Plugin</title>
      <dc:creator>Amit Sahoo</dc:creator>
      <pubDate>Sat, 01 Mar 2025 18:37:48 +0000</pubDate>
      <link>https://dev.to/connectamitsahoo/introducing-tracejs-a-lightweight-jquery-based-text-highlighter-plugin-46ec</link>
      <guid>https://dev.to/connectamitsahoo/introducing-tracejs-a-lightweight-jquery-based-text-highlighter-plugin-46ec</guid>
      <description>&lt;h2&gt;
  
  
  🌟 What is Trace.js?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/connectamitsahoo/trace.js" rel="noopener noreferrer"&gt;Trace.js&lt;/a&gt; is a &lt;strong&gt;lightweight jQuery plugin&lt;/strong&gt; for highlighting words or phrases inside HTML elements.&lt;/p&gt;

&lt;p&gt;🚀 &lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Supports &lt;strong&gt;case-sensitive&lt;/strong&gt; and &lt;strong&gt;case-insensitive&lt;/strong&gt; searches.&lt;/li&gt;
&lt;li&gt;✅ Highlights &lt;strong&gt;full or partial matches&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;✅ Works with dynamic content.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Zero dependencies!&lt;/strong&gt; Just jQuery required.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚡ Why I Built Trace.js
&lt;/h2&gt;

&lt;p&gt;Recently, one of my junior developers needed to highlight a word inside a list of paragraphs dynamically. This gave me an idea what should I build next.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 How to Install Trace.js
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Method 1️⃣ Install via NPM
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i trace-text-highlighter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2️⃣ Use CDN
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&amp;lt;script &lt;span class="nv"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;lt;/script&amp;gt;
&amp;lt;script &lt;span class="nv"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://cdn.jsdelivr.net/gh/connectamitsahoo/trace.js@latest/dist/trace.min.js"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛠 How to use Trace.js
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="s2"&gt;"#content"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;.trace&lt;span class="o"&gt;({&lt;/span&gt;
                match: &lt;span class="s2"&gt;"highlight"&lt;/span&gt;,     // Word to highlight
                color: &lt;span class="s2"&gt;"yellow"&lt;/span&gt;,        // Highlight color &lt;span class="o"&gt;(&lt;/span&gt;default: yellow&lt;span class="o"&gt;)&lt;/span&gt;
                traceType: &lt;span class="s2"&gt;"full"&lt;/span&gt;,      // Only highlights full words &lt;span class="o"&gt;(&lt;/span&gt;default: partial&lt;span class="o"&gt;)&lt;/span&gt;
                caseSensitive: &lt;span class="nb"&gt;true&lt;/span&gt;     // Enables &lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="nt"&gt;-sensitive&lt;/span&gt; matching. &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
            &lt;span class="o"&gt;})&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🏆 Real-World Use Cases
&lt;/h2&gt;

&lt;p&gt;🔹 &lt;strong&gt;Search Result Highlighting&lt;/strong&gt; – Highlight user search queries dynamically.&lt;br&gt;
🔹 &lt;strong&gt;Content Emphasis&lt;/strong&gt; – Highlight key terms in articles or documentation.&lt;br&gt;
🔹 &lt;strong&gt;Live Text Filtering&lt;/strong&gt; – Visually emphasize matching text in real-time.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Feedback &amp;amp; Contributions Welcome!
&lt;/h2&gt;

&lt;p&gt;Trace.js is &lt;strong&gt;open-source&lt;/strong&gt; under the &lt;a href="https://opensource.org/licenses/MIT" rel="noopener noreferrer"&gt;MIT License&lt;/a&gt;. Check out the repo and feel free to contribute or report issues!&lt;br&gt;
🔗 &lt;a href="https://github.com/connectamitsahoo/trace.js" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;br&gt;
🔗 &lt;a href="https://www.npmjs.com/package/trace-text-highlighter" rel="noopener noreferrer"&gt;NPM Package&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me know what you think! Drop a comment below. 🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>jquery</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
