@web-dev-media/localstorage

1.3.4 • Public • Published

localstorage made simple

a lightweight javascript to handel localstorage.

Install

npm install --save @web-dev-media/localstorage

Usage

require

const localstorageJs = require("@web-dev-media/localstorage");

const cacheOptions = {
    cacheTime: 24 * 60,
    cacheKey: 'fooo_bar',
    data: 'foo_abcd',
};

localstorageJs.set(
    cacheOptions.cacheKey,
    cacheOptions.data,
    cacheOptions.cacheTime
);

let dataFromLocalCache = localstorageJs.get(cacheOptions.cacheKey);

localstorageJs.remove(cacheOptions.cacheKey)

contact

Package Sidebar

Install

npm i @web-dev-media/localstorage

Weekly Downloads

0

Version

1.3.4

License

MIT

Unpacked Size

311 kB

Total Files

20

Last publish

Collaborators

  • web-dev-media