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-storage

v3.0.0

Published

In-memory storage adapter 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-storage

Storage interface and memory adapter for the Dismissible system.

Part of the Dismissible API - This library is part of the Dismissible API ecosystem. Visit dismissible.io for more information and documentation.

Overview

This library provides:

  • IDismissibleStorage - Interface that all storage adapters must implement
  • MemoryStorageAdapter - In-memory storage implementation (useful for development and testing)
  • Storage abstraction layer for the Dismissible system

Installation

npm install @dismissible/nestjs-storage

Getting Started

Using In-Memory Storage

The memory storage adapter is useful for development, testing, or when you don't need persistence:

import { Module } from '@nestjs/common';
import { StorageModule, MemoryStorageAdapter } from '@dismissible/nestjs-storage';
import { LoggerModule } from '@dismissible/nestjs-logger';
import { DismissibleItemModule } from '@dismissible/nestjs-item';

@Module({
  imports: [
    LoggerModule.forRoot({}),
    DismissibleItemModule,
    StorageModule.forRoot({
      adapter: MemoryStorageAdapter,
    }),
  ],
})
export class AppModule {}

Implementing a Custom Storage Adapter

You can implement your own storage adapter by implementing the IDismissibleStorage interface:

import { Injectable, Inject } from '@nestjs/common';
import { IDismissibleStorage, DISMISSIBLE_STORAGE_ADAPTER } from '@dismissible/nestjs-storage';
import { DismissibleItemDto } from '@dismissible/nestjs-item';
import { DISMISSIBLE_LOGGER, IDismissibleLogger } from '@dismissible/nestjs-logger';

@Injectable()
export class MyCustomStorageAdapter implements IDismissibleStorage {
  constructor(@Inject(DISMISSIBLE_LOGGER) private readonly logger: IDismissibleLogger) {}

  async get(userId: string, itemId: string): Promise<DismissibleItemDto | null> {
    // Your implementation
    this.logger.debug('Getting item', { userId, itemId });
    // ...
  }

  async create(item: DismissibleItemDto): Promise<DismissibleItemDto> {
    // Your implementation
    this.logger.debug('Creating item', { itemId: item.id });
    // ...
  }

  async update(item: DismissibleItemDto): Promise<DismissibleItemDto> {
    // Your implementation
    this.logger.debug('Updating item', { itemId: item.id });
    // ...
  }

  async delete(userId: string, itemId: string): Promise<void> {
    // Your implementation
    this.logger.debug('Deleting item', { userId, itemId });
    // ...
  }

  async deleteAll(): Promise<void> {
    // Your implementation
    this.logger.debug('Deleting all items');
    // ...
  }
}

// Register your adapter
@Module({
  providers: [
    MyCustomStorageAdapter,
    {
      provide: DISMISSIBLE_STORAGE_ADAPTER,
      useExisting: MyCustomStorageAdapter,
    },
  ],
  exports: [DISMISSIBLE_STORAGE_ADAPTER],
})
export class MyStorageModule {}

API Reference

IDismissibleStorage Interface

interface IDismissibleStorage {
  get(userId: string, itemId: string): Promise<DismissibleItemDto | null>;
  create(item: DismissibleItemDto): Promise<DismissibleItemDto>;
  update(item: DismissibleItemDto): Promise<DismissibleItemDto>;
  delete(userId: string, itemId: string): Promise<void>;
  deleteAll(): Promise<void>;
}

MemoryStorageAdapter

An in memory implementation of IDismissibleStorage. Data is stored in a Map and will be lost when the application restarts.

Note: This adapter is suitable for development and testing only. For production use, consider using @dismissible/nestjs-postgres-storage or implementing your own persistent storage adapter.

StorageModule

StorageModule.forRoot(options)

Configures the storage module with the provided adapter.

Options:

  • adapter: Type<IDismissibleStorage> - The storage adapter class to use

Returns: DynamicModule

Injection Token

The storage adapter is provided via the DISMISSIBLE_STORAGE_ADAPTER injection token:

import { Inject } from '@nestjs/common';
import { DISMISSIBLE_STORAGE_ADAPTER, IDismissibleStorage } from '@dismissible/nestjs-storage';

@Injectable()
export class MyService {
  constructor(
    @Inject(DISMISSIBLE_STORAGE_ADAPTER)
    private readonly storage: IDismissibleStorage,
  ) {}
}

Related Packages

  • @dismissible/nestjs-core - Main dismissible service (uses storage adapters)
  • @dismissible/nestjs-postgres-storage - PostgreSQL storage adapter implementation
  • @dismissible/nestjs-item - Data models used by storage adapters
  • @dismissible/nestjs-logger - Logging used by storage adapters

License

MIT