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

strata-storage

v2.4.3

Published

Zero-dependency universal storage plugin providing a unified API for all storage operations across web, Android, and iOS platforms

Downloads

25

Readme

Strata Storage

📚 Documentation

Getting Started

Core Documentation

Storage Adapters

Advanced Features

Platform Guides

Common Patterns

Examples

Resources


One API. Every Storage. Everywhere.

Zero-dependency universal storage plugin providing a unified API for all storage operations across web, Android, and iOS platforms.

🚀 Quick Start

npm install strata-storage

Provider-less Usage (Zero Setup)

import { storage } from 'strata-storage';

// Works immediately - no setup, no providers, no initialization!
await storage.set('user', { name: 'John', age: 30 });
const user = await storage.get('user');

Complete Example App

Check out our React + Capacitor example app that demonstrates all features:

  • All storage adapters working correctly
  • Web, Android, and iOS platform support
  • Real-time testing interface
  • Complete error handling

Run the example:

cd examples/react-capacitor-app
yarn install
yarn start  # For web
npx cap run android  # For Android
npx cap run ios  # For iOS

With Capacitor (Optional)

import { storage } from 'strata-storage';
import { registerCapacitorAdapters } from 'strata-storage/capacitor';

// Only if you need native features
if (window.Capacitor) {
  await registerCapacitorAdapters(storage);
}

// Use native storage when available
await storage.set('secure-data', 'secret', { storage: 'secure' });

With Firebase (Optional)

import { storage } from 'strata-storage';
import { enableFirebaseSync } from 'strata-storage/firebase';

// Only if you need cloud sync
if (needCloudSync) {
  await enableFirebaseSync(storage, {
    apiKey: 'your-api-key',
    projectId: 'your-project-id',
    firestore: true
  });
}

// Works offline-first, syncs when online
await storage.set('data', value, { storage: 'firestore' });

✨ Features

Core Features

  • Zero Dependencies - No runtime dependencies, pure implementation
  • Provider-less Architecture - No providers, contexts, or wrappers needed (like zustand)
  • Works Everywhere - React, Vue, Angular, Vanilla JS, Node.js - same API
  • Zero Configuration - Import and use immediately, no setup required
  • Opt-in Complexity - Start simple, add features only when needed
  • Dynamic Provider Loading - Providers load only when used, keeping bundle small
  • Universal API - Single interface for all storage types
  • Cross-Platform - Web, iOS, Android support
  • TypeScript - Full type safety and IntelliSense
  • Auto Fallback - Intelligent storage selection

Storage Adapters

  • Memory - Fast in-memory storage
  • LocalStorage - Persistent browser storage
  • SessionStorage - Session-based browser storage
  • IndexedDB - Large-scale browser database
  • Cookies - HTTP cookie storage
  • Cache API - Service worker cache storage
  • Capacitor Preferences - Native mobile preferences
  • SQLite - Mobile SQL database
  • Secure Storage - Keychain (iOS) / Encrypted SharedPreferences (Android)
  • Filesystem - File-based storage

Advanced Features

📖 Basic Usage

import { storage } from 'strata-storage';

// No initialization needed - works immediately!

// Simple usage
await storage.set('key', 'value');
const value = await storage.get('key');
await storage.remove('key');
await storage.clear();

// Advanced options
await storage.set('key', value, {
  storage: 'indexedDB',  // Choose specific storage
  ttl: 3600000,         // Expire in 1 hour
  encrypt: true,        // Encrypt this value
  compress: true,       // Compress if beneficial
  tags: ['user-data'],  // Tag for grouping
  metadata: {           // Attach metadata
    version: 1,
    source: 'api'
  }
});

// Query data with MongoDB-like syntax
const results = await storage.query({
  tags: { $in: ['user-data'] },
  'value.age': { $gte: 18 },
  'metadata.version': 1
});

// Subscribe to changes
storage.subscribe((change) => {
  console.log(`${change.key} changed from ${change.oldValue} to ${change.newValue}`);
});

// Check storage size
const size = await storage.size();
console.log(`Using ${size.total} bytes for ${size.count} items`);

🎯 Why Strata Storage?

Provider-less Architecture

Like Zustand, Strata Storage works without providers, contexts, or wrappers. Just import and use - no setup required.

Zero Dependencies

Truly zero runtime dependencies. Everything is implemented from scratch for maximum control and minimal bundle size.

Universal Compatibility

  • One API - Same code works on Web, iOS, and Android
  • Any Framework - Works with React, Vue, Angular, or vanilla JavaScript
  • TypeScript First - Full type safety and excellent IntelliSense
  • Tree-Shakeable - Only bundle what you use

Intelligent Storage Selection

Automatically selects the best available storage based on:

  • Platform capabilities
  • Data size and type
  • Performance requirements
  • Persistence needs

Enterprise Ready

  • Encryption - Built-in AES-GCM encryption
  • Compression - Automatic data compression
  • TTL/Expiration - Auto-cleanup of expired data
  • Sync - Real-time cross-tab/device synchronization
  • Migrations - Version-based data migrations
  • Querying - MongoDB-like query engine

🏗 Project Status

Production Ready - All major features implemented:

  • ✅ Zero-dependency architecture
  • ✅ Provider-less design (like Zustand)
  • ✅ All web storage adapters (localStorage, IndexedDB, etc.)
  • ✅ Complete Capacitor integration (iOS/Android)
  • ✅ Native implementations (iOS Swift, Android Java)
  • ✅ Advanced features (encryption, compression, sync, query, TTL)
  • ✅ Framework integrations (React, Vue, Angular)
  • ✅ Comprehensive documentation
  • ✅ Full TypeScript support
  • ✅ Example application with all features

📄 License

Apache 2.0 - See LICENSE and License Details

Quick Summary:

  • Free for commercial use
  • Modify and distribute
  • Patent protection included
  • ⚠️ Must keep attribution
  • No warranty provided

Created by Ahsan Mahmood