# good-storage

> a storage lib which support sessionStorage and localStorage with the same api

Latest version **1.1.1** (published 2020-02-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-02-27 |
| First published | 2017-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/good-storage) |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 473 |
| Author | ustbhuangyi |
| Maintainers | ustbhuangyi |
| Keywords | store, html5 |

## Links

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

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2020-02-27
- 1.1.0 — 2018-11-05
- 1.0.1 — 2017-04-09
- 1.0.0 — 2017-04-09

## README

# storage
a storage lib which support sessionStorage and localStorage with the same api

## Install

```
 npm install good-storage
```

## Usage

```
 import storage from 'good-storage'
 
 // localStorage
 storage.set(key,val) 
 
 storage.get(key, def)
 
 // sessionStorage
 storage.session.set(key, val)
 
 storage.session.get(key, val)
 
```

## API

#### set(key, val)

set storage with key and val

#### get(key, def)

get storage with key, return def if not find

#### remove(key)

remove storage with key

#### has(key)

determine storage has the key

#### clear()
clear all storages

#### getAll()
get all the storages

#### forEach(callback)
forEach the storages and call the callback function with each storage

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