# storage2

> html5 storage interface for node and browser

Latest version **0.1.2** (published 2021-06-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install storage2
pnpm add storage2
yarn add storage2
bun add storage2
```

## 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.2 |
| Published | 2021-06-23 |
| First published | 2015-08-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Wang Zuo |
| Maintainers | adjusted |
| Keywords | localStorage, polyfill, sessionStorage, storage |

## Links

- npm: https://www.npmjs.com/package/storage2
- Repository: https://github.com/swiftcarrot/storage2
- Homepage: https://github.com/swiftcarrot/storage2#readme
- Issues: https://github.com/swiftcarrot/storage2/issues
- npm.io page: https://npm.io/package/storage2

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2021-06-23
- 0.1.1 — 2019-08-11
- 0.1.0 — 2017-07-11
- 0.0.2 — 2015-08-14
- 0.0.1 — 2015-08-12

## README

# storage2

[![Build Status](https://travis-ci.org/swiftcarrot/storage2.svg)](https://travis-ci.org/swiftcarrot/storage2) [![codecov.io](http://codecov.io/github/swiftcarrot/storage2/coverage.svg?branch=master)](http://codecov.io/github/swiftcarrot/storage2?branch=master)

HTML5 storage interface for node and browser

- `node`: simple memory storage
- `browser with storage api available`: return global storage object directly (`window.localStorage` and `window.sessionStorage`)
- `browser without storage api`: cookie fallback

### Installation

```sh
npm install storage2 --save
```

### Usage

```javascript
var ls = require("storage2").localStorage;
var ss = require("storage2").sessionStorage;
```

For safari private mode, `localStorage` and `sessionStorage` will still be available globally but storage usage will cause an exception. `localStorage = require('storage2').localStorage` is not recommended and a different variable name like `ls` should always be used.

### API

[Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Storage)

### License

ISC

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