# @studyportals/data-storage

> Create a browser independent local storage solution.

Latest version **2.0.0** (published 2022-06-23) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @studyportals/data-storage
pnpm add @studyportals/data-storage
yarn add @studyportals/data-storage
bun add @studyportals/data-storage
```

## 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 | 2.0.0 |
| Published | 2022-06-23 |
| First published | 2018-06-20 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | StudyPortals B.V. |
| Maintainers | martinestudyportals, simaopcsantos, sp-andrei-dobre, aobermeier, skrothapalli1, armandduijnstudyportals, borismo, victor.vacarescu, michaelaplas, southpark, alexandramarginean, jooshuys, alfalfamale, studyportals-devops, sp_xminions, jens-sp, stormyy, rafaelsp, stefanklokgieters, royvaneijndhovensp |

## Links

- npm: https://www.npmjs.com/package/@studyportals/data-storage
- npm.io page: https://npm.io/package/@studyportals/data-storage

## Recent versions

- 2.0.0 (latest) — 2022-06-23
- 2.0.0-10 (beta) — 2022-06-15
- 1.2.2 (alpha) — 2018-11-05
- 2.0.0-11 — 2022-06-15
- 2.0.0-9 — 2022-06-15
- 2.0.0-8 — 2022-06-15
- 2.0.0-7 — 2022-06-15
- 2.0.0-6 — 2022-06-15
- 2.0.0-5 — 2022-06-14
- 2.0.0-4 — 2022-06-14
- 2.0.0-3 — 2022-06-14
- 2.0.0-2 — 2022-06-14
- 2.0.0-1 — 2022-06-14
- 2.0.0-0 — 2022-06-14
- 1.3.0 — 2019-01-08
- … 9 more at https://npm.io/package/@studyportals/data-storage/versions

## README

# DataStorage
Create a browser independent local storage solution.

## Installation:
This package is written in ES5 and is available on NPM.
```node
npm install --save @studyportals/data-storage
```

## Functions:
_Javascript_
```javascript
import {DataStorage} from "@studyportals/data-storage";

/**
 * Store any type of value with an TTL of 1800 seconds.
 */
DataStorage.store('AnyObject', {
    prop1: 'test-1',
    prop2: 'test-2'
}, 1800);

/**
 * Retrieve from the storage.
 */
DataStorage.retrieve('AnyObject');

/**
 * Remove an object from the storage.
 */
DataStorage.remove('AnyObject');

/**
 * Add properties to an existing object with an TTL of 1800 seconds.
 */
DataStorage.update('AnyObject', {
    prop3: 'test-3'
}, 1800);
```

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