# simple-browser-storage

> Module wich gives you opportunity storing your JSON data in localStorage or Cookies (dependent on what is accessible for current browser)

Latest version **0.1.3** (published 2015-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-browser-storage
pnpm add simple-browser-storage
yarn add simple-browser-storage
bun add simple-browser-storage
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2015-12-17 |
| First published | 2015-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Voloshin Sergey http://voloshins.js.org/ |
| Maintainers | voloshins |
| Keywords | cookie, localstorage, browser storage |

## Links

- npm: https://www.npmjs.com/package/simple-browser-storage
- Repository: https://github.com/VoloshinS/simpleStorage
- Homepage: https://github.com/VoloshinS/simpleStorage#readme
- Issues: https://github.com/VoloshinS/simpleStorage/issues
- npm.io page: https://npm.io/package/simple-browser-storage

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2015-12-17
- 0.1.2 — 2015-12-17
- 0.1.1 — 2015-11-12
- 0.1.0 — 2015-11-12
- 0.0.6 — 2015-10-27
- 0.0.5 — 2015-09-01
- 0.0.4 — 2015-08-31
- 0.0.3 — 2015-08-31
- 0.0.2 — 2015-08-31
- 0.0.1 — 2015-08-28
- 0.0.0 — 2015-08-28

## README

# simpleStorage
Module gives you opportunity to store your simple JSON data in localStorage or Cookies (dependent on what is accessible for current browser)

# Usage

To install with npm:

```javascript
npm install --save simple-browser-storage
```

And then any where you want to use module:

```javascript
var opts = {name: 'StorageName', expiresTime: 10}
var browserStorage = require('simple-browser-storage')(opts);

// In your Cookies (or localStorage) will be created an empty JSON object.
// You can communicate with it through following intreface:
browserStorage.setState(dataObject);
browserStorage.getState(); // Returns whole data object;
browserStorage.stateIsExpired(); // Returns whether expired or not dataObject;
```

# Options

```javascript
opts = {
  name: 'String', // Name of JSON object which will be created. Default: "SimpleBrowserStorage"
  expiresTime: 'Number' // Time in minutes after which data will be deleted on next browser refresh. Default: 10
}
```

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