npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@isel-jao/cache-manager

v0.0.4

Published

Typed, multi-tier cache with pluggable stores (memory, Redis, MongoDB).

Readme

@iseljao/cache-manager

Typed, multi-tier cache with pluggable stores (memory, Redis, MongoDB).

Installation

pnpm add @iseljao/cache-manager

The memory adapter works out of the box. Other adapters need their driver installed:

| Adapter | Import | Export | Extra dependency | | ------- | -------------------------------- | -------------------- | ------------------ | | Memory | @iseljao/cache-manager | MemoryStoreAdapter | none | | Redis | @iseljao/cache-manager/redis | RedisStoreAdapter | pnpm add ioredis | | MongoDB | @iseljao/cache-manager/mongodb | MongoStoreAdapter | pnpm add mongodb |

CacheManager and the shared types are exported from @iseljao/cache-manager. These three are the only import paths; deep imports such as @iseljao/cache-manager/adapters/... are not supported.

Usage

import { CacheManager, MemoryStoreAdapter } from "@iseljao/cache-manager";
import { RedisStoreAdapter } from "@iseljao/cache-manager/redis";

const cache = new CacheManager<{ user: { name: string } }>({
  stores: [new MemoryStoreAdapter(), new RedisStoreAdapter({ url: "redis://localhost:6379" })],
  onError: console.error,
});

await cache.start();
await cache.set("user", { name: "Ada" }, { ttl: 60 });
await cache.get("user");
await cache.dispose();

Options

| Option | Default | Description | | ---------- | -------- | ------------------------------------------------------------ | | stores | required | Checked in order, fastest first | | onError | required | Gets errors from stores that the manager recovers from | | strict | false | Throw on get/set errors instead of skipping the store | | fillBack | true | Copy hits from lower tiers into the tiers above (see below) |

set takes ttl in seconds or expiresAt as a timestamp in milliseconds.

Fill-back

get checks the stores in order. A hit in a lower tier is copied into the tiers above it in the background, with the original expiry kept. Fill-back errors go to onError. To turn it off, pass fillBack: false.

Error handling

  • get: a failing store counts as a miss and the next store is tried.
  • set: the other stores are still written.
  • delete and clear throw an AggregateError if any store fails, even without strict, since a failed delete leaves stale data behind.
  • start: if any store fails, the ones that started are disposed, then it throws.

With strict: true, get and set throw instead of reporting to onError.