A localStorage wrapper that falls back to memory in private browsing mode.
npm install locastore
const store = require('locastore')()
OR
import Locastore from "locastore"
const store = new Locastore()
namespace
is a string to prefix to each key.
Retrieve a key. If localStorage.getItem()
fails, falls back to memory store.
Store a key in memory and with localStorage.setItem()
.
Removes a key from memory and localStorage.removeItem()
.
Removes all items from memory and localStorage within the namespace.
Removes all items from memory and localStorage.
- local-store A localStorage based store with name spacing
- local-storage A simplified localStorage API that just works
(c) 2023 Kyle Robinson Young. MIT License