# uc-storage

> Local and session storage with JSON support

Latest version **1.0.0** (published 2018-06-26) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-06-26 |
| First published | 2018-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexey Novikov |
| Maintainers | velocityzen |
| Keywords | unchained, ui, browser, storage, json, kiss |

## Links

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

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-06-26

## README

# Unchained UI

## Storage

[![NPM Version](https://img.shields.io/npm/v/uc-storage.svg?style=flat-square)](https://www.npmjs.com/package/uc-storage)
[![NPM Downloads](https://img.shields.io/npm/dt/uc-storage.svg?style=flat-square)](https://www.npmjs.com/package/uc-storage)

Local and session storage with JSON support

### Usage

```js
import { localStorage, sessionStorage, JSONStorage } from 'uc-storage'

sessionStorage.setItem('name', 'value')
const storage = JSONStorage(localStorage)

storage.set('data', [ 1, 2, 3 ])
const data = storage.get('data')
console.log(Array.isArray(data));
// true

```

### Storage

This module exports the safe **localStorage**, **sessionStorage** with API identical to browser's.

### JSONStorage(storage)

Wraps the `storage` object to save and parse JSON data inside the storage

#### set(key, value)

Sets the value

#### get(key)

Returns the value

#### remove(key)

Removes the key from the storage

License MIT

© velocityzen

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