# pdsb-storage-manager

> Simple web storage manager to work with multiple apps under the same domain.

Latest version **0.0.7** (published 2019-02-07) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install pdsb-storage-manager
pnpm add pdsb-storage-manager
yarn add pdsb-storage-manager
bun add pdsb-storage-manager
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-02-07 |
| First published | 2018-11-09 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 420.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | justacodemonkey |

## Links

- npm: https://www.npmjs.com/package/pdsb-storage-manager
- Repository: https://github.com/JustACodeMonkey/pdsb-storage-manager
- Issues: https://github.com/JustACodeMonkey/pdsb-storage-manager/issues
- npm.io page: https://npm.io/package/pdsb-storage-manager

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 0.0.7 (latest) — 2019-02-07
- 0.0.6 — 2019-02-07
- 0.0.5 — 2019-02-01
- 0.0.4 — 2018-11-20
- 0.0.3 — 2018-11-20
- 0.0.2 — 2018-11-20
- 0.0.1 — 2018-11-09

## README

# pdsb-storage-manager
- Simple web storage manager to work with multiple apps under the same domain.
- The manager will use local / session storage if available.
- Otherwise, it will revert to using cookies.

### Information
- Items common across applications are prefixed with '/sis/', otherwise, they are prefixed with '/BASE_HREF/'.
- When using local / session storage, items set to expire use sessionStorage, otherwise, localStorage is used.
- In the case of cookies, items set to persist are appended with '/!' to signify a non-session cookie.

### Usage
- Provide the PdsbStorageManagerService in your app.module.ts file.
- Inject the service into your component, service, etc.

#### get(key: string): string 
- Returns the object stored at the given key

#### set(key: string, val: string | number | boolean | object | Array<any>, expires: boolean = true, common: boolean = false): boolean
- Sets the object by storing it in local or session storage (or to a cookie)

#### remove(key: string, track: boolean = true)
- Removes an item from either the local or session storage (or from a cookie)

#### removeAll(force: boolean = true)
- Removes all session storage items either for the app only, or for the '/common/' items as well

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