# sl-storage

> Auto Fallback Storage

Latest version **1.0.0** (published 2019-04-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-04-28 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 84.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | cutsin |

## Links

- npm: https://www.npmjs.com/package/sl-storage
- Repository: https://github.com/cutsin/sl-storage
- Homepage: https://github.com/cutsin/sl-storage#readme
- Issues: https://github.com/cutsin/sl-storage/issues
- npm.io page: https://npm.io/package/sl-storage

## Recent versions

- 1.0.0 (latest) — 2019-04-28
- 0.4.0 — 2018-07-16
- 0.3.0 — 2018-07-11
- 0.2.0 — 2018-02-06
- 0.1.0 — 2018-02-01
- 0.0.2 — 2018-02-01
- 0.0.1 — 2018-02-01

## README

# Auto Fallback Storage

```javascript
// If browser in private mode, auto fallback to cache
// sessionStorage > memoryStorage
// localStorage > memoryStorage
```

## Usage

```javascript
import Storage from 'sl-storage'

// LocalStorage
Storage.LS.set('foo', 'bar')
Storage.LS.get('foo', 'bar') // >> bar
Storage.LS.getSet('foo', 'bar') // >> bar
Storage.LS.del('foo')

// SessionStorage
Storage.SS.set('foo', 'bar')
Storage.SS.get('foo', 'bar') // >> bar
Storage.SS.getSet('foo', 'bar') // >> bar
Storage.SS.del('foo')

// Both
Storage.SLS.set('foo', 'oops')
Storage.SLS.get('foo', 'oops') // >> oops
Storage.LS.get('foo', 'oops') // >> oops
Storage.SS.get('foo', 'oops') // >> oops
```

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