1.3.4 • Published 2 years ago

@web-dev-media/localstorage v1.3.4

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

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