<?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: subhadip pahari</title>
    <description>The latest articles on DEV Community by subhadip pahari (@subhadip_pahari_1cd6ddc60).</description>
    <link>https://dev.to/subhadip_pahari_1cd6ddc60</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%2F2067282%2F0bebe9f2-69c1-418c-b9a5-444536c6c599.png</url>
      <title>DEV Community: subhadip pahari</title>
      <link>https://dev.to/subhadip_pahari_1cd6ddc60</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/subhadip_pahari_1cd6ddc60"/>
    <language>en</language>
    <item>
      <title>Want suggestions on my npm package</title>
      <dc:creator>subhadip pahari</dc:creator>
      <pubDate>Thu, 18 Sep 2025 14:11:24 +0000</pubDate>
      <link>https://dev.to/subhadip_pahari_1cd6ddc60/want-suggestions-on-my-npm-package-3if9</link>
      <guid>https://dev.to/subhadip_pahari_1cd6ddc60/want-suggestions-on-my-npm-package-3if9</guid>
      <description>&lt;p&gt;I created a npm package for in-memory cache. Kind of node-cache alternative.&lt;/p&gt;

&lt;p&gt;I added :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;General cache &lt;/li&gt;
&lt;li&gt;LRU cache &lt;/li&gt;
&lt;li&gt;Tag cache&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can keep backup of the cache in disk (encrypted or non encrypted).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/flexi-cache-node" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/flexi-cache-node&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I want your suggestions on the package. What other functionalities you want to add or any other improvements.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>npm</category>
      <category>programming</category>
    </item>
    <item>
      <title>Introducing Flexi-Cache : The Redis-Like In-Memory Cache for Node.js</title>
      <dc:creator>subhadip pahari</dc:creator>
      <pubDate>Sat, 30 Aug 2025 17:04:36 +0000</pubDate>
      <link>https://dev.to/subhadip_pahari_1cd6ddc60/introducing-flexi-cache-node-the-redis-lite-in-memory-cache-for-nodejs-3do3</link>
      <guid>https://dev.to/subhadip_pahari_1cd6ddc60/introducing-flexi-cache-node-the-redis-lite-in-memory-cache-for-nodejs-3do3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuqsqrw7xshpyvgm37seo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuqsqrw7xshpyvgm37seo.png" alt=" " width="320" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tired of complex caching solutions for your small to mid-size Node.js projects? While powerful, tools like Redis can be overkill, requiring a full stack installation and a steep learning curve. The solution is here: flexi-cache-node, a lightweight and versatile in-memory cache that provides robust functionality without the overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Choose flexi-cache-node?&lt;/strong&gt;&lt;br&gt;
Traditionally, developers had limited options for caching. The popular node-cache package offers basic functionality, but it often lacks advanced features. On the other end, Redis provides a distributed, feature-rich cache but can be cumbersome for smaller projects or proof-of-concept applications.&lt;/p&gt;

&lt;p&gt;Flexi-cache-node fills this gap. It's a Redis replacement for projects that need a simple, fast, and flexible caching solution. It's designed to be instantly accessible, allowing you to add powerful caching to your application in minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Flexi-cache-node stands out with its feature-rich design, offering key functionalities essential for modern caching strategies:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In-Memory Store: The cache stores data directly in your application's memory for lightning-fast retrieval, eliminating network latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple Eviction Policies: The library offers multiple strategies to manage cache size, including TTL (Time-to-Live) and LRU (Least Recently Used). You can choose the policy that best fits your data access patterns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tagging: In addition to standard key-value pairs, flexi-cache-node supports a tag cache implementation, allowing you to group related data and perform targeted invalidations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Persistence: Flexi-cache-node can persist snapshots of your cache to a MongoDB database, ensuring your data is not lost during server restarts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Performance Metrics: The package provides a statistics object to track crucial metrics like hit and miss rates, giving you real-time insight into the cache's performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Ideal Use Cases&lt;/strong&gt;&lt;br&gt;
Flexi-cache-node is perfect for developers building APIs, or proof-of-concept projects where speed and ease of use are paramount. It's the go-to solution for projects that require flexibility and a high usability-to-complexity ratio, providing all the essential caching features without the unnecessary bloat.&lt;/p&gt;

&lt;p&gt;NPM link : &lt;a href="https://www.npmjs.com/package/flexi-cache-node" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/flexi-cache-node&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started, simply install the package and begin integrating it into your Node.js application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install flexi-cache-node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>My new NPM package for cache 🚀</title>
      <dc:creator>subhadip pahari</dc:creator>
      <pubDate>Wed, 27 Aug 2025 07:46:59 +0000</pubDate>
      <link>https://dev.to/subhadip_pahari_1cd6ddc60/introducing-flexi-cache-node-a-modern-zero-dependency-replacement-for-node-cache-35g2</link>
      <guid>https://dev.to/subhadip_pahari_1cd6ddc60/introducing-flexi-cache-node-a-modern-zero-dependency-replacement-for-node-cache-35g2</guid>
      <description>&lt;p&gt;Introducing flexi-cache-node: A Modern, Zero-Dependency Replacement for node-cache.&lt;/p&gt;

&lt;p&gt;Caching is one of those invisible building blocks that keeps applications fast, reliable, and efficient. If you’ve ever used node-cache, you know how handy it can be — but also how limited.&lt;/p&gt;

&lt;p&gt;That’s why I built flexi-cache-node : a zero-dependency, TypeScript-ready caching library for Node.js with modern features baked in.&lt;/p&gt;




&lt;p&gt;Why I built it 💡&lt;/p&gt;

&lt;p&gt;I needed a cache that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;could expire keys (TTL) reliably,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;had LRU eviction so memory wouldn’t blow up,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;supported tags so I could bulk-delete groups of keys,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;could persist data to disk securely,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;worked seamlessly in both JavaScript and TypeScript,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and most importantly… had zero dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Instead of bolting these features on top of node-cache, I decided to start fresh.&lt;/p&gt;




&lt;p&gt;What makes flexi-cache-node different ✨&lt;/p&gt;

&lt;p&gt;-- ⏱ TTL (Time-To-Live) per key or global&lt;/p&gt;

&lt;p&gt;-- ♻ LRU eviction to keep size under control&lt;/p&gt;

&lt;p&gt;-- 🏷 Tag-based grouping for smarter key management&lt;/p&gt;

&lt;p&gt;-- 💾 Disk persistence with crash-safe writes&lt;/p&gt;

&lt;p&gt;-- 🔒 AES-256-GCM encryption for at-rest data security&lt;/p&gt;

&lt;p&gt;-- 📊 Stats &amp;amp; events — track hits, misses, expirations&lt;/p&gt;

&lt;p&gt;-- 🔧 Works with JavaScript &amp;amp; TypeScript out of the box&lt;/p&gt;

&lt;p&gt;-- 🪶 Zero dependencies — smaller, safer, faster&lt;/p&gt;

&lt;p&gt;Think of it as the caching library I wish existed when I started out.&lt;/p&gt;




&lt;p&gt;Installation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install flexi-cache-node
# or
yarn add flexi-cache-node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please check out the examples for practical use cases in various scenarios.&lt;/p&gt;




&lt;p&gt;example 1:  Basic in-memory cache&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const NodeCache = require("flexi-cache-node");

const cache = new NodeCache({ stdTTL: 5 });
cache.set("foo", "bar");

console.log(cache.get("foo")); // "bar"

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

&lt;/div&gt;






&lt;p&gt;example 2: Tag-based cache&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { TagCache } = require("flexi-cache-node");

const tc = new TagCache();
tc.setWithTags("user:1", { name: "Alice" }, ["active", "premium"]);
tc.setWithTags("user:2", { name: "Bob" }, ["active"]);

console.log(tc.getValuesByTag("active"));
// → [ { name: "Alice" }, { name: "Bob" } ]

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

&lt;/div&gt;






&lt;p&gt;example 3: LRU eviction&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { LRUCache } = require("flexi-cache-node");

const lru = new LRUCache({ size: 2 });
lru.set("a", 1);
lru.set("b", 2);
lru.get("a");
lru.set("c", 3); // evicts "b"

console.log(lru.getKeys()); // [ "a", "c" ]

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

&lt;/div&gt;






&lt;p&gt;example 4: Persistence with encryption&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const NodeCache = require("flexi-cache-node");

const cache = new NodeCache({
  encryption: true,
  secretKey: "superSecretKey123",
  persistPathFolder: {
    type: "disk",
    diskConfig: { folderLocation: "./cache-data" }
  }
});

cache.set("token", { id: 123 });
await cache.flush(); // writes encrypted snapshot

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

&lt;/div&gt;






&lt;p&gt;Coming soon 🔮&lt;/p&gt;

&lt;p&gt;Browser-based cache (using LocalStorage &amp;amp; SessionStorage)&lt;/p&gt;

&lt;p&gt;Cloud persistence (S3, GCP, Azure)&lt;/p&gt;

&lt;p&gt;Compression for large values&lt;/p&gt;




&lt;p&gt;Final thoughts ❤️&lt;/p&gt;

&lt;p&gt;Please give flexi-cache-node a try and let me know any feedback.&lt;br&gt;
I’m open to modifying or improving it based on your suggestions — let’s make caching in Node.js a little less boring and a lot more powerful together ✨.&lt;/p&gt;

</description>
      <category>node</category>
      <category>npm</category>
      <category>redis</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
