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

@blockialabs/ssi-storage

v2.0.8

Published

A library for storing and retrieving data in decentralized identity systems.

Readme

SSI Storage

The ssi-storage package provides a unified storage abstraction for Self-Sovereign Identity (SSI) systems. It offers a consistent interface for data persistence with support for different storage backends.

Installation

Install the package via NPM:

npm install @blockialabs/ssi-storage

Key Components

Core Interface

  • IStorage<T>: Generic storage interface with async operations

Implementations

  • InMemoryStorage<T>: In-memory storage implementation
  • AbstractStorage<T>: Base class for custom storage implementations

Drivers

  • InMemoryDriver: Driver for in-memory storage operations

Basic Usage

Using In-Memory Storage

import { InMemoryStorage } from '@blockialabs/ssi-storage';

// Create storage instance
const storage = new InMemoryStorage<string>();

// Store data
await storage.set('key1', 'Hello, World!');
await storage.set('key2', 'SSI Storage');

// Retrieve data
const value = await storage.get('key1');
console.log(value); // 'Hello, World!'

// Check existence
const exists = await storage.has('key1');
console.log(exists); // true

// List all keys
const keys = await storage.keys();
console.log(keys); // ['key1', 'key2']

// Delete data
await storage.delete('key1');

// Clear all data
await storage.clear();

Generic Type Support

// Typed storage for complex objects
interface User {
  id: string;
  name: string;
  email: string;
}

const userStorage = new InMemoryStorage<User>();

await userStorage.set('user123', {
  id: 'user123',
  name: 'John Doe',
  email: '[email protected]',
});

const user = await userStorage.get('user123');
console.log(user?.name); // 'John Doe'

Custom Storage Implementation

Extending AbstractStorage

import { AbstractStorage } from '@blockialabs/ssi-storage';
import { IStorageDriver } from '@blockialabs/ssi-storage';

class CustomDriver implements IStorageDriver {
  // Implement storage operations
  async get(key: string): Promise<unknown> {
    // Custom retrieval logic
    return data;
  }

  async set(key: string, value: unknown): Promise<void> {
    // Custom storage logic
  }

  async delete(key: string): Promise<void> {
    // Custom deletion logic
  }

  async has(key: string): Promise<boolean> {
    // Custom existence check
    return exists;
  }

  async clear(): Promise<void> {
    // Custom clear logic
  }

  async keys(): Promise<string[]> {
    // Custom keys listing
    return keys;
  }
}

Storage Options

Configure storage behavior with options:

const storage = new InMemoryStorage({
  namespace: 'namespace',
  encryption: 'true',
  ttl: '3600',
});

Building

Run nx build ssi-storage to build the library.

Running unit tests

Run nx test ssi-storage to execute the unit tests via Jest.

Running lint

Run nx lint ssi-storage to check if there are lint errors.

See LICENSE.