npm.io
5.0.1 • Published 7 years ago

ts-storage

Licence
MIT
Version
5.0.1
Deps
1
Size
18 kB
Vulns
0
Weekly
0
Stars
2

ts-storage

Type-safe storage library with fallback values

NPM Version Downloads Stats

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.

Keywords