@shanzhai/ephemeral-keyed-store

A keyed Shanzhai store which holds data in memory until the application closes.

Usage no npm install needed!

<script type="module">
  import shanzhaiEphemeralKeyedStore from 'https://cdn.skypack.dev/@shanzhai/ephemeral-keyed-store';
</script>

README

@shanzhai/ephemeral-keyed-store Continuous Integration License FOSSA Status Renovate enabled npm npm type definitions

A keyed Shanzhai store which holds data in memory until the application closes.

Usage

This is an implementation of KeyedStore, and can be used anywhere requiring one.

const store = new EphemeralKeyedStore<number>(`Test Name`);

store.set(`Test Key A`, 5);
store.set(`Test Key B`, 6);
store.set(`Test Key C`, 7);

store.delete(`Test Key B`);

store.get(`Test Key A`); // 5.
store.getAll(); // { "Test Key A": 5, "Test Key C": 7 }
store.getKeys(); // [`Test Key A`, `Test Key B`]

All information is stored in-memory, and will be lost when the application is closed.

Dependencies

This package has no runtime dependencies.

Peer Dependencies

This package has no runtime peer dependencies (it does not expect any other packages to be installed alongside itself).

License

FOSSA Status