
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
A lightweight, type-safe state management library for JavaScript applications
License is private completely free to use (no modification)
npm i -D memorio
Total: 28 tests passed across 5 test suites
/*
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');
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();
Observe state changes with React-like syntax:
// Basic observer
observer(
'state.user',
(newValue, oldValue) => {
console.log('User updated:', newValue);
}
);
// 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);
}
);
}, []
);
useObserve changes with React-like useEffect syntax:
// Basic useObserver
useObserver(
() => {
console.log('User updated:', newValue)
, 'state.user'
}
);
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();
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();
Permanent storage using browser database:
idb.db.create("Database")
idb.data.set("Database","table", { id: 1, data:{...} } )
[in development]
idb.data.get("Database","table", 1 )
[in development]
idb.db.delete("Database") // Remove DB
idb.table.delete("Database","table") // Remove only "table"
Total: 25 tests passed across 5 test suites
Security scans and reports are available at:
PRIVATE (c) Dario Passariello
Created with by Dario Passariello - Copyright (c) 2025
FAQs
Memorio, State + Observer and Store for an easy life
The npm package memorio receives a total of 546 weekly downloads. As such, memorio popularity was classified as not popular.
We found that memorio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.