<?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: Noname from the internet</title>
    <description>The latest articles on DEV Community by Noname from the internet (@internet-no-namer).</description>
    <link>https://dev.to/internet-no-namer</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%2F2393173%2Fe85cc94b-2cc0-4a53-a6a3-c6b32d68bf88.gif</url>
      <title>DEV Community: Noname from the internet</title>
      <link>https://dev.to/internet-no-namer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/internet-no-namer"/>
    <language>en</language>
    <item>
      <title>Introducing Vanicom.js: A Minimalist JavaScript Helper Library</title>
      <dc:creator>Noname from the internet</dc:creator>
      <pubDate>Thu, 06 Mar 2025 19:56:37 +0000</pubDate>
      <link>https://dev.to/internet-no-namer/introducing-vanicomjs-a-minimalist-javascript-helper-library-62e</link>
      <guid>https://dev.to/internet-no-namer/introducing-vanicomjs-a-minimalist-javascript-helper-library-62e</guid>
      <description>&lt;p&gt;When it comes to building simple web interfaces, sometimes you don’t need the heavy artillery of libraries like “jQuery” or “lodash”. You need a lightweight, simple helper that simplifies common tasks without adding unnecessary bloat to your project. And perhaps surprisingly for some, building a frontend with a builder (like Webpack or Vite) with React (Vue, Next, etc.) isn’t always desirable either — often you just need a few extra features to make a fully functional page in pure HTML. That’s where &lt;strong&gt;&lt;a href="https://www.npmjs.com/package/vanicom" rel="noopener noreferrer"&gt;Vanicom.js&lt;/a&gt;&lt;/strong&gt; comes in. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Vanicom.js?
&lt;/h2&gt;

&lt;p&gt;Vanicom (short for "vanilla commons") is a microframework designed to provide small, handy utility functions for everyday JavaScript tasks. It’s written in pure, vanilla JavaScript with no external dependencies, making it perfect for small projects or when you want to keep things simple and fast.&lt;/p&gt;

&lt;p&gt;The library is designed to work in browsers as old as IE9, so it includes some polyfills for ES6 features. This makes it a great choice for projects that don’t use bundlers like Babel or Webpack, or for those who still need to support older browsers (though, let’s be honest, their share is shrinking every day).&lt;/p&gt;

&lt;h3&gt;
  
  
  What Vanicom.js is &lt;strong&gt;NOT&lt;/strong&gt;:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It’s not a replacement for jQuery.&lt;/strong&gt; If you’re looking for a full-fledged DOM manipulation library, this isn’t it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It’s not trying to be lodash.&lt;/strong&gt; While lodash is fantastic for complex data manipulation, Vanicom.js is much simpler and focuses on basic utilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It’s not reinventing the wheel.&lt;/strong&gt; It’s just a collection of small, useful functions that make your life a bit easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Vanicom.js?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Minimalism is Key
&lt;/h3&gt;

&lt;p&gt;In the world of web development, performance is king. Vanicom.js is all about keeping things lightweight and fast. Modern web APIs are powerful enough to handle most tasks natively, so why drag in a massive library when you only need a few helper functions?&lt;/p&gt;

&lt;h3&gt;
  
  
  Polyfills for Older Browsers
&lt;/h3&gt;

&lt;p&gt;Yes, I know—most of us don’t need to worry about IE9 anymore. But for those rare cases where you do, Vanicom.js has you covered. The library includes polyfills for some ES6 features, ensuring compatibility with older browsers. And don’t worry, as these browsers fade into obscurity, you can easily drop the polyfills.&lt;/p&gt;

&lt;h3&gt;
  
  
  No Prototype Pollution
&lt;/h3&gt;

&lt;p&gt;I’m aware of the concerns around Prototype Pollution, but after years of using this approach, I haven’t encountered any issues. Plus, as older browsers become less relevant, many of these concerns will naturally fade away.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use Vanicom.js
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;You can install Vanicom.js via npm:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then, import the functions you need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;logg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getRandomString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isObject&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vanicom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or, if you prefer to use it as a standalone library (&lt;em&gt;yeaah, as if it's 2010 now&lt;/em&gt;), just include the script in your HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"vanicom.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Of course, don't forget to download &lt;code&gt;vanicom.min.js&lt;/code&gt; first from the &lt;a href="https://github.com/Psychosynthesis/Vanicom/releases" rel="noopener noreferrer"&gt;releases page&lt;/a&gt; on GitHub.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;All functions will be available globally, so you can start using them right away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples of Vanicom.js in Action
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Simplified Logging
&lt;/h3&gt;

&lt;p&gt;The first thing that always bugged me was having to type &lt;code&gt;console.log&lt;/code&gt; every time I wanted to debug something. With Vanicom.js, it’s as simple as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;logg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, world!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Shortcut for console.log&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Type Checking Made Easy
&lt;/h3&gt;

&lt;p&gt;Checking types in JavaScript can be annoying. For example, ensuring that a variable is an &lt;code&gt;object&lt;/code&gt; (and not an &lt;code&gt;array&lt;/code&gt; or &lt;code&gt;null&lt;/code&gt;) usually requires a convoluted check. With Vanicom.js, it’s just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;isObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;someVar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true if it's an object, false otherwise&lt;/span&gt;
&lt;span class="nf"&gt;isObject&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;span class="nf"&gt;isExistAndNotNull&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;span class="nf"&gt;isNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1254&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;span class="nf"&gt;isNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;NaN&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No more writing &lt;code&gt;!Array.isArray(value) &amp;amp;&amp;amp; typeof value === 'object' &amp;amp;&amp;amp; value !== null&lt;/code&gt;. Just simplest functions call.&lt;/p&gt;

&lt;p&gt;No more stupid questions on stackoverflow!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes, I'm sure you've seen this a thousand times, but I'm really tired of writing something like this in my projects, and I don't want to drag out another five dependencies for the sake of such a trifle, so HERE it is, a super-simple helper WITHOUT dependencies.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Random Numbers and Strings
&lt;/h3&gt;

&lt;p&gt;Need a random number or string? Ok, here we go, Vanicom.js has you covered:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getRandomNum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Returns a random number between 1 and 100&lt;/span&gt;
&lt;span class="nf"&gt;getRandomString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Returns a random 10-character string&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. DOM and strings manipulation
&lt;/h3&gt;

&lt;p&gt;Working with DOM or strings? I'm sure there are a bunch of little things you've done a thousand times. While Vanicom.js isn’t a DOM manipulation library, it does include a few handy helpers, like deleting a DOM node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;deleteNode&lt;/span&gt;&lt;span class="p"&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;someElement&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or make first character in a string uppercase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;capz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;capzed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// return 'Capzed'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yes, I know about &lt;code&gt;:first-letter&lt;/code&gt;, but it's not always convenient.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Cookies and LocalStorage
&lt;/h3&gt;

&lt;p&gt;Working with cookies and LocalStorage is a breeze:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;setCookie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;authToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;12345&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Set a cookie with a 1-hour expiry&lt;/span&gt;
&lt;span class="nf"&gt;getCookie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;authToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Retrieve the cookie value&lt;/span&gt;

&lt;span class="nf"&gt;setLocalItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;86400000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Store a theme preference for 24 hours&lt;/span&gt;
&lt;span class="nf"&gt;getLocalItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Retrieve the stored value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Toasts for Quick Messages
&lt;/h3&gt;

&lt;p&gt;Need to show a quick message to the user? Vanicom.js includes a simple toast function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;toast&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Success!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;custom-toast&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// Or even simpler:&lt;/span&gt;
&lt;span class="nf"&gt;toast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Message!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// And if you need to hide it manually:&lt;/span&gt;
&lt;span class="nf"&gt;hideToast&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are a few more cool little things there, you can see the full list on &lt;a href="https://github.com/Psychosynthesis/Vanicom" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Keep It Simple?
&lt;/h2&gt;

&lt;p&gt;The web is moving towards faster, more efficient experiences. Vanicom.js is my way of advocating for minimalism in web development. You don’t always need a massive library to get the job done. Sometimes, a few well-crafted utility functions are all you need to keep your project lean and performant.&lt;/p&gt;

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

&lt;p&gt;Vanicom.js isn’t trying to be the next big thing. It’s just a small, practical library that solves a few common problems in a simple way. If you’re working on a small project or just want to keep your codebase lightweight, give Vanicom.js a try. It might just save you a few lines of code—and a few headaches.&lt;/p&gt;

&lt;p&gt;You can find the library on &lt;a href="https://github.com/Psychosynthesis/Vanicom" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and install it via npm. And remember, it’s distributed under the MIT license, so feel free to use it however you like. Just don’t forget to give credit where it’s due!&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

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