# storage-mgmt

> It's a simple HTML 5 local and session storage management

Latest version **1.0.1** (published 2019-12-20) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.0.1 |
| Published | 2019-12-20 |
| First published | 2019-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10.15.0 |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nobuyuki Kondo |
| Maintainers | arcone |
| Keywords | HTML5, localstorage, sessionstorage, javascript, storage |

## Links

- npm: https://www.npmjs.com/package/storage-mgmt
- Repository: https://github.com/arcone-nk/storage-mgmt
- Issues: https://github.com/arcone-nk/storage-mgmt/issues
- npm.io page: https://npm.io/package/storage-mgmt

## 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.0.1 (latest) — 2019-12-20
- 1.0.0 — 2019-12-15
- 0.1.0 — 2019-12-15
- 0.0.17 — 2019-12-15

## README

# Simple Storage Manager

[![CircleCI](https://circleci.com/gh/arcone-nk/storage-mgmt/tree/master.svg?style=svg)](https://circleci.com/gh/arcone-nk/storage-mgmt/tree/master)

Simple HTML5 storage management (local storage and session storage)

## install

```bash
$ npm install --save storage-mgmt
# or
$ yarn add storage-mgmt
```

## Usage

```javascript
// use local storage
import { strLocal } from 'storage-mgmt'

// storage set
strLocal.set('data', { a: 2 })

// storage get
strLocal.get('data')

//--------//

// use session storage
import { strSession } from 'storage-mgmt'

// storage set
strSession.set('data', [1, 2, 3])

// storage get
strSession.get('data')
```

## Methods

### strLocal.set(key, val) | strSession.set(key, val)

data save or overwrite.

#### Params

**key**  
Type: `string`  
storage key

**val**  
Type: `boolean | string | number | object<string, string | number | boolean> | Array<Array<string | number | boolean>>`  
 save or overwrite data.

#### Return

`this`

#### example

```javascript
import { strLocal } from 'storage-mgmt'

strLocal.set('flg', true)

// pipe
strLocal.set('data', { foo: 'bar' }).set('sum', 10)
```

### strLocal.get(key) | strSession.get(key)

read storage data.

#### Params

**key**  
Type: `string`  
storage key

#### Return

`boolean | string | number | object<string, string | number | boolean> | Array<Array<string | number | boolean>> | null`

#### example

```javascript
import { strLocal } from 'storage-mgmt'

strLocal.set('flg', true)

const flg = strLocal.get('flg') // -> true
const data = strLocal.get('data') // -> null
```

### strLocal.remove(key) | strSession.remove(key)

delete specific data.

#### Params

**key**  
Type: `string`  
storage key

#### Return

`this`

#### example

```javascript
import { strLocal } from 'storage-mgmt'

strLocal.set('flg', true)

strLocal.remove('flg')
const flg = strLocal.get('flg') // -> null

// pipe

strLocal.set('data', {foo: 'bar'}).remove('data').set('flg', true)
const data = strLocal.get('data') // -> null
```

### strLocal.clear() | strSession.clear()

storage all delete.  
Note that even necessary data may be deleted.

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