@arvind-yadav/local-store
v1.0.1
Published
A type-safe wrapper for localStorage and sessionStorage with expiry (TTL) support.
Maintainers
Readme
@arvind-yadav/local-store
A type-safe wrapper for localStorage and sessionStorage with JSON serialization and TTL (expiry) support.
Installation
npm install @arvind-yadav/local-storeUsage
import { localStore, sessionStore } from '@arvind-yadav/local-store';
// Set value with 1 hour Expiry (TTL)
localStore.set('token', 'xyz123', { ttl: 3600000 });
// Get value
const token = localStore.get<string>('token');