ts-storage
v5.0.1
Published
Type-safe storage library with fallback values
Downloads
977
Maintainers
Readme
ts-storage
Type-safe storage library with fallback values
A simple library for interacting with the browser's local storage in a type-safe manner (with TypeScript).
Installation
npm install ts-storage --save
Usage
import * as Storage from "ts-storage";
Storage.set("foo", 5);
const foo = Storage.get("foo", 0).value;
// foo is guaranteed to be a number.