Package Exports
- stash-it-plugin-readonly
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stash-it-plugin-readonly) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme

stash-it-plugin-readOnly
Read-only plugin for stash-it.
The problem
Let's say you need to have an instance of stash-it that is only capable of reading from the storage, but not writing, changing or deleting anything.
Solution
This plugin will allow you to do just that. And if anyone will try to write / delete something, an error will be thrown.
Installation
npm i stash-it-plugin-readonly --saveUsage
import { createCache } from 'stash-it';
import createReadOnlyPlugin from 'stash-it-plugin-readonly';
// You can use any adapter
import createMemoryAdapter from 'stash-it-adapter-memory';
const cacheInstance = createCache(createMemoryAdapter());
const readOnlyPlugin = createReadOnlyPlugin();
const readOnlyCacheInstance = cacheInstance.registerPlugins([ readOnlyPlugin ]);
// This will work
readOnlyCacheInstance.hasItem('key');
// But this will throw
readOnlyCacheInstance.removeItem('key');
// or this
readOnlyCacheInstance.setItem('key', 'value');Methods that will throw are: setItem, addExtra, setExtra and removeItem. All other will work just fine.