This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

ephemeral-store

0.0.1 • Public • Published

Ephemeral Store

Why?

The Store class's use case is to be an ephemeral key-value store that only persists within the life time of a single user session. It intentionally provides a similar interface to localStorage or a browser's cookie storage.

However, it differs from them significantly as it's not persisted and is hence not subject to prior cookie consent policies of the European Union. (At least that's what I'm hoping for lol.)

An alternative to the Store class would be to set a cookie, but omit its expires date. Of course, using a plain JS object would be fine too.

Installation

$ npm i --save ephemeral-store

Usage

const EphemeralStore = require("ephemeral-store");
const store = new EphemeralStore();
store.setItem("hello", "world");
store.getItem("hello");
store.removeItem("hello");
store.clear();

License

See License.

Package Sidebar

Install

npm i ephemeral-store

Weekly Downloads

0

Version

0.0.1

License

GPL-3.0-only

Unpacked Size

39 kB

Total Files

6

Last publish

Collaborators

  • timdaub