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

memorio

v2.2.1

Published

Memorio, State + Observer and Store for a easy life

Readme

memorio

A lightweight, type-safe state management library for JavaScript applications

version downloads

TypeScript Node.js Jest ESLint esbuild

License

License is private completely free to use (no modification)

Table of Contents

Features

  • Reactive state management with observer pattern
  • Persistent storage with Store API
  • Session management for temporary data
  • Type-safe with full TypeScript support
  • Comprehensive test coverage
  • Easy debugging with proxy-based state

Installation

npm i -D memorio

All test suites are passing

  • Basic functionality tests
  • State management tests
  • Store operations tests
  • Cache operations tests
  • Observer pattern tests
  • useObserver pattern tests

Total: 28 tests passed across 5 test suites

Quick Start

/*
 IMPORTANT!
 Add import only at first start of your SPA. Became global!.
 You don't need to import any time you need to use memorio
*/

import 'memorio';

// State Management
state.counter = 0;
state.active = false;
state.name = "john";
state.user = { name: 'John', age: 30 };
state.hours = [2,3,10,23]

// Observer Pattern
// Example: if you change the state.counter you get a console.log
observer(
  'state.counter',
    (newValue, oldValue) => {
    console.log(`Counter changed from ${oldValue} to ${newValue}`);
  }
);

// useObserver Pattern
// Example: if you change the state.counter you get a console.log
useObserver(
    () => {
      console.log(`Counter changed from ${oldValue} to ${newValue}`);
    }, 'state.counter'
);


// Store (Persistent Storage)
store.set('preferences', { theme: 'dark' });
const preferences = store.get('preferences');

// Session Storage
session.set('token', 'user-jwt-token');
const token = session.get('token');

API Reference

State Management

State in Memorio is globally accessible and reactive:

// Setting state
state.user = { name: 'John' };

// Getting state
const userName = state.user.name;

// Listing all states
console.log(state.list);

// Locking state (for Objects or Arrays)
state.user.lock();

// Removing state
state.remove('user');

// Clearing all states
state.removeAll();

Observer Pattern

Observe state changes with React-like syntax:


// Basic observer
observer(
  'state.user',
    (newValue, oldValue) => {
    console.log('User updated:', newValue);
  }
);
  1. You can use in a function outside React
  2. In a javascript function
  3. in a setTimeout

// With React useState
const [user, setUser] = useState();
observer(
  'state.user',
  () => {
    setUser(state.user);
  }
);

// With React useEffect to avoid multiple observer after update
useEffect(
  () => {
    observer(
      'state.user',
      () => {
        setUser(state.user);
      }
    );
  }, []
);

useObserver Pattern

useObserve changes with React-like useEffect syntax:


// Basic useObserver
useObserver(
    () => {
    console.log('User updated:', newValue)
    , 'state.user'
  }
);
  1. You can use in a function outside React
  2. In a javascript function
  3. in a setTimeout

Store

Persistent storage for your application:

// Setting values
store.set('config', { theme: 'dark', language: 'en' });

// Getting values
const config = store.get('config');

// Removing specific value
store.remove('config');

// Getting store size
const size = store.size();

// Clearing store
store.removeAll();

Session

Temporary storage that persists during page sessions:

// Setting session data
session.set(
  'userSession', {
    id: 'user123',
    lastActive: Date.now()
  }
);

// Getting session data
const userData = session.get('userSession');

// Checking session size
const activeItems = session.size();

// Removing session data
session.remove('userSession');

// Clearing all session data
session.removeAll();

idb

Permanent storage using browser database:

Create database

idb.db.create("Database")

Set data into table

idb.data.set("Database","table", { id: 1, data:{...} } )

Get data from table

[in development]

idb.data.get("Database","table", 1 )

Delete database / table

[in development]

idb.db.delete("Database") // Remove DB
idb.table.delete("Database","table") // Remove only "table"

Testing

Test suites are passing

  • Basic functionality tests
  • State management tests
  • Store operations tests
  • Cache operations tests
  • Observer pattern tests

Total: 25 tests passed across 5 test suites

Security

Security scans and reports are available at:

License

PRIVATE (c) Dario Passariello

Created with by Dario Passariello - Copyright (c) 2025