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

@angular-helpers/storage

v1.2.0

Published

Sistema de almacenamiento reactivo premium para Angular con soporte para Cache API, IndexedDB, compresión TOON y blindaje en runtime.

Readme

📐 @angular-helpers/storage

A premium, high-performance, and secure reactive storage system for Angular. It bridges a fast synchronous L1 memory Signal Cache with async L2 storage backends (Cache API, IndexedDB, Local/SessionStorage) with optional AES-GCM encryption, dynamic TOON compression, and surgical key-level reactive Entity management.


⚡ Quick Path

1. Import and Setup

import { injectStorageSignal, injectEntityStore } from '@angular-helpers/storage';

2. Basic Signal Storage (L1 + L2 Cache API)

// Synchronous L1 Signal, Native Cache API L2 in background
const userPref = injectStorageSignal('user-pref', 'light-mode', {
  storageType: 'cacheapi',
  serializer: 'json',
});

// Read value (automatically handles async loading states)
console.log(userPref().data); // 'light-mode'
console.log(userPref().loading); // true | false

// Reactive write - auto-persists to Cache API
userPref.set({ data: 'dark-mode', loading: false, error: null });

3. High-Performance Entity Store

interface Product {
  id: string;
  name: string;
  price: number;
}

const productStore = injectEntityStore<string, Product>({
  idKey: 'id',
  persistKey: 'products-cache',
  storageOptions: {
    storageType: 'indexeddb',
    serializer: 'toon', // Compresses payload up to 60%!
  },
});

// 1. Write-Once, Freeze-Once O(1) insertion
productStore.setOne({ id: 'P1', name: 'Laptop', price: 999 });

// 2. Read entities safely (frozen in runtime, compile-time ReadonlyMap)
const laptop = productStore.entities().get('P1');
// laptop.price = 1000; // ❌ Throws TypeError in runtime, compile error in TS!

// 3. Surgical Granular Reactivity
// This computed signal ONLY evaluates when product 'P1' changes.
// Updates to product 'P2' will NOT trigger re-evaluation!
const productSignal = productStore.entitySignal('P1');
const laptopName = computed(() => productSignal()?.name);

🔬 Under the Hood

| Core Feature | Technical Strategy | Cognitive Benefit | | :------------------------- | :----------------------------------------------- | :------------------------------------------------------------------------------------- | | Strategy Transport | Pluggable StorageTransport interface | MVP on main thread today, 100% transparent Shared Worker upgrade tomorrow. | | Native Cache API | Directly utilizes window.caches | Offloads heavy JSON/TOON parsing off the main thread natively via Response.json(). | | Write-Once Freeze-Once | Object.freeze applied only on set operations | Guaranteed immutability with near-zero read performance penalty. | | TOON Serializer | Pluggable token-based serializer | Compresses structured array payloads by 30-60%, bypassing standard 5MB storage limits. | | WebCrypto AES-GCM | Native asynchronous browser cryptography | Seamlessly encrypts data at rest with hardware-accelerated algorithms. |


🛠️ Verification Checklist

  • [ ] Runtime immutability: Bypassing compile safety via (store.entities() as any).set(...) throws a runtime TypeError.
  • [ ] Granular updates: Modifying entity A does not trigger change evaluation on components listening to entity B.
  • [ ] Incognito boundaries: Safari private browsing fallback automatically protects active signals when database writes fail.