Moving from localForage
localForage and Strata Storage both give you async key-value calls over IndexedDB. If your app only ever runs in a browser and you're happy with localForage, there's no reason to move. Move when the same code also ships under Capacitor, or you want sessionStorage, cookies or the URL behind the same call.
The calls
| localForage | Strata Storage |
|---|---|
localforage.setItem(key, value) | storage.set(key, value) |
localforage.getItem(key) | storage.get(key) |
localforage.removeItem(key) | storage.remove(key) |
localforage.keys() | storage.keys() |
localforage.clear() | storage.clear() |
localforage.config({ driver }) | defineStorage({ defaultStorages }) |
There's no iterate(): call keys() and get() in a loop, or use query() when you're filtering on a field of the value.
Carry existing values over
The two libraries don't share a database. Strata's IndexedDB adapter opens its own (StrataStorage unless you configure dbName), so existing values have to be copied once. Run this at startup before anything reads the moved keys.
import localforage from 'localforage';
import { defineStorage } from 'strata-storage';
export const storage = defineStorage({ defaultStorages: ['indexedDB', 'localStorage', 'memory'] });
export async function moveFromLocalForage(): Promise<void> {
if (await storage.get<boolean>('moved:localforage')) return;
for (const key of await localforage.keys()) {
await storage.set(key, await localforage.getItem(key));
}
await storage.set('moved:localforage', true);
}
The flag goes last, so a tab closed halfway repeats the copy on the next start instead of skipping what's left.
Before you clear the old store
Read a few real keys back through storage.get(). If you keep Blob values, read one of those too: IndexedDB can hold it, but a localStorage fallback can't. Once you're satisfied, ship await localforage.clear() in a later release, so a rollback still finds its data.
Adding native stores is a separate step: see Capacitor setup and check the read on a device.
localForage as we checked it
Last checked 7 Nov 2026. "Not stated" means the pages we checked don't mention it, not that the library can't do it. Check localForage yourself, or see the side-by-side page.
| Store or capability | localForage | Strata Storage |
|---|---|---|
| localStorage | Yes (source, 7 Nov 2026) | Yes |
| IndexedDB | Yes (source, 7 Nov 2026) | Yes |
| sessionStorage | Not stated on the pages we checked | Yes |
| Cookies | Not stated on the pages we checked | Yes |
| URL parameters as a store | Not stated on the pages we checked | Yes |
| iOS Keychain | Not stated on the pages we checked | Yes |
| Android secure storage (Keystore-backed) | Not stated on the pages we checked | Yes |
| Native preferences (UserDefaults / SharedPreferences) | Not stated on the pages we checked | Yes |
| Web and native stores behind one API | No. The README says it is designed to run in the browser; no native store is described (source, 7 Nov 2026) | Yes |
| No runtime dependencies | No. Depends on lie (source, 7 Nov 2026) | Yes |
| Package fact | localForage | Strata Storage |
|---|---|---|
| Licence | Apache-2.0 (source) | MIT (source) |
| npm version | 1.10.0 | 3.1.4 |
| Bundle size | 8,680 bytes gzipped, 28,346 minified, version 1.10.0, 7 Nov 2026 (source) | 21,468 bytes gzipped, 79,645 minified, version 3.1.4, 7 Nov 2026 (source) |
| Weekly downloads | 11,046,386, 31 Oct 2026 to 6 Nov 2026 (source) | 486, 31 Oct 2026 to 6 Nov 2026 (source) |