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

@dismissible/nestjs-cache

v3.1.1

Published

Cache adapter interface for Dismissible

Readme

Dismissible manages the state of your UI elements across sessions, so your users see what matters, once! No more onboarding messages reappearing on every tab, no more notifications haunting users across devices. Dismissible syncs dismissal state everywhere, so every message is intentional, never repetitive.

@dismissible/nestjs-cache

Cache interface and null adapter for the Dismissible system.

Overview

This library provides:

  • IDismissibleCache - Interface that all cache adapters must implement
  • NullCacheAdapter - No-op cache implementation (used when caching is disabled)
  • Cache abstraction layer for the Dismissible system

Installation

npm install @dismissible/nestjs-cache

Getting Started

Using Null Cache (Default)

The null cache adapter is used by default when no cache is configured. It performs no operations and is useful when caching is not needed:

import { Module } from '@nestjs/common';
import { CacheModule } from '@dismissible/nestjs-cache';
import { DismissibleModule } from '@dismissible/nestjs-core';

@Module({
  imports: [
    DismissibleModule.forRoot({
      cache: CacheModule, // Uses NullCacheAdapter by default
    }),
  ],
})
export class AppModule {}

Implementing a Custom Cache Adapter

You can implement your own cache adapter by implementing the IDismissibleCache interface:

import { Injectable, Inject } from '@nestjs/common';
import { IDismissibleCache, DISMISSIBLE_CACHE_ADAPTER } from '@dismissible/nestjs-cache';
import { DismissibleItemDto } from '@dismissible/nestjs-item';

@Injectable()
export class MyCustomCacheAdapter implements IDismissibleCache {
  async get(userId: string, itemId: string): Promise<DismissibleItemDto | null> {
    // Your implementation
    // ...
  }

  async getMany(userId: string, itemIds: string[]): Promise<Map<string, DismissibleItemDto>> {
    // Your implementation
    // ...
  }

  async set(item: DismissibleItemDto): Promise<void> {
    // Your implementation
    // ...
  }

  async setMany(items: DismissibleItemDto[]): Promise<void> {
    // Your implementation
    // ...
  }

  async delete(userId: string, itemId: string): Promise<void> {
    // Your implementation
    // ...
  }

  async deleteMany(userId: string, itemIds: string[]): Promise<void> {
    // Your implementation
    // ...
  }
}

// Register your adapter
@Module({
  providers: [
    MyCustomCacheAdapter,
    {
      provide: DISMISSIBLE_CACHE_ADAPTER,
      useExisting: MyCustomCacheAdapter,
    },
  ],
  exports: [DISMISSIBLE_CACHE_ADAPTER],
})
export class MyCacheModule {}

API Reference

IDismissibleCache Interface

interface IDismissibleCache {
  get(userId: string, itemId: string): Promise<DismissibleItemDto | null>;
  getMany(userId: string, itemIds: string[]): Promise<Map<string, DismissibleItemDto>>;
  set(item: DismissibleItemDto): Promise<void>;
  setMany(items: DismissibleItemDto[]): Promise<void>;
  delete(userId: string, itemId: string): Promise<void>;
  deleteMany(userId: string, itemIds: string[]): Promise<void>;
}

NullCacheAdapter

A no-op implementation of IDismissibleCache. All methods return empty/null values or perform no operations. This adapter is used by default when no cache is configured.

Note: This adapter is suitable when caching is not needed. For production use with caching, consider using @dismissible/nestjs-memory-cache or @dismissible/nestjs-redis-cache.

CacheModule

CacheModule

The base cache module that provides NullCacheAdapter by default. When used in DismissibleModule.forRoot(), it enables optional caching support.

License

MIT