ts-storage
TypeScript icon, indicating that this package has built-in type declarations

5.0.1 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 5.0.1
    39
    • latest

Version History

Package Sidebar

Install

npm i ts-storage

Weekly Downloads

46

Version

5.0.1

License

MIT

Unpacked Size

18.3 kB

Total Files

8

Last publish

Collaborators

  • alling