ts-storage

Type-safe storage library with fallback values

MIT License

Downloads
234
Stars
2
Committers
2

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.