# ts-storage

> Type-safe storage library with fallback values

Latest version **5.0.1** (published 2019-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-storage
pnpm add ts-storage
yarn add ts-storage
bun add ts-storage
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2019-09-08 |
| First published | 2018-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Simon Alling |
| Maintainers | alling |
| Keywords | type-safe, localStorage, fallback, default, TypeScript |

## Links

- npm: https://www.npmjs.com/package/ts-storage
- Repository: https://github.com/simonalling/ts-storage
- Issues: https://github.com/simonalling/ts-storage
- npm.io page: https://npm.io/package/ts-storage

## Dependencies (1)

- [ts-type-guards](https://npm.io/package/ts-type-guards.md) ^0.6.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 5.0.1 (latest) — 2019-09-08
- 5.0.0 — 2019-01-02
- 4.0.0 — 2018-09-10
- 3.1.0 — 2018-09-02
- 3.0.0 — 2018-09-01
- 2.0.0 — 2018-07-13
- 1.0.1 — 2018-07-06
- 1.0.0 — 2018-07-02
- 0.2.0 — 2018-03-26
- 0.1.0 — 2018-02-19

## README

# ts-storage
> Type-safe storage library with fallback values

[![NPM Version][npm-image]][npm-url]
[![Downloads Stats][npm-downloads]][npm-url]

A simple library for interacting with the browser's local storage in a type-safe manner (with TypeScript).


## Installation

```sh
npm install ts-storage --save
```


## Usage

```javascript
import * as Storage from "ts-storage";

Storage.set("foo", 5);

const foo = Storage.get("foo", 0).value;
// foo is guaranteed to be a number.
```


[npm-image]: https://img.shields.io/npm/v/ts-storage.svg
[npm-url]: https://npmjs.org/package/ts-storage
[npm-downloads]: https://img.shields.io/npm/dm/ts-storage.svg

---
_Source: https://npm.io/package/ts-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
