README
dtStorage.js
ES6 class for REST-like management of local and session storages.
Features
- ES6
- local copy of storage (Safari has a bug with storage in private browsing mode)
Install
npm install --save dtstorage
Usage
constructor(provider)
import dtStorage from 'dtstorage';
const MyStorage = new dtStorage(provider);
or, if you're using UMD build,
<script src="/dtstorage/dist/index.min.js"></script>
<script>
const MyStorage = new dtStorage(provider);
</script>
where provider
is localStorage
or sessionStorage
.
get(resource)
get resource
data
post(resource, body)
create new entry in resource
patch(resource, key, value)
set key=value
in resource
del(resource)
delete resource