# sessionstorage

> sessionStorage API which gracefully degrades to window.name & cookies when not available

Latest version **0.1.0** (published 2018-04-24) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2018-04-24 |
| First published | 2014-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Arnout Kazemier |
| Maintainers | 3rdeden, v1 |
| Keywords | sessionstorage, storage, session, fallback |

## Links

- npm: https://www.npmjs.com/package/sessionstorage
- Repository: https://github.com/unshiftio/sessionstorage
- Issues: https://github.com/unshiftio/sessionstorage/issues
- npm.io page: https://npm.io/package/sessionstorage

## Dependencies (3)

- [koekje](https://npm.io/package/koekje.md) ^0.1.0
- [objstorage](https://npm.io/package/objstorage.md) ^1.0.0
- [window.name](https://npm.io/package/window.name.md) ^0.0.3

## 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.0 (latest) — 2018-04-24
- 0.0.2 — 2016-11-28
- 0.0.1 — 2015-10-05
- 0.0.0 — 2014-12-17

## README

# sessionstorage

[![Made by unshift][made-by]](http://unshift.io)[![Version npm][version]](http://browsenpm.org/package/sessionstorage)[![Build Status][build]](https://travis-ci.org/unshiftio/sessionstorage)[![Dependencies][david]](https://david-dm.org/unshiftio/sessionstorage)[![Coverage Status][cover]](https://coveralls.io/r/unshiftio/sessionstorage?branch=master)[![IRC channel][irc]](http://webchat.freenode.net/?channels=unshift)

[made-by]: https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square
[version]: https://img.shields.io/npm/v/sessionstorage.svg?style=flat-square
[build]: https://img.shields.io/travis/unshiftio/sessionstorage/master.svg?style=flat-square
[david]: https://img.shields.io/david/unshiftio/sessionstorage.svg?style=flat-square
[cover]: https://img.shields.io/coveralls/unshiftio/sessionstorage/master.svg?style=flat-square
[irc]: https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square

The `sessionStorage` API is amazing and super useful when you need to store data
temporarily in the browser. We used to abuse cookies for this, but not all the
data that you want to store needs to be synced with the server. The
`sessionStorage` API filled that gap, but unfortunately we cannot expect this API
to be available and enabled in every browser context. This module provides
various of fallbacks which follow the same API as `sessionStorage` for when it's
not enabled. The following fallback's are supported:

- `window.name` - Storing data in the `name` property of the window.
- `cookies` - This doesn't really need an explanation.

## Install

It's build for browserify but it should work with Node.js as well as we provide
a fallback API. The module is released in the public npm registry and can be
installed using:

```
npm install --save sessionstorage
```

## Usage

The API is exactly the same as the DOM storage API so you can use the following
methods:

- `getItem(key)`
- `setItem(key, value)`
- `removeItem(key)`
- `clear()`

So all you need to do is require the module and you're ready to go:

```js
'use strict';

var sessionstorage = require('sessionstorage');
```

## License

MIT

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