@zero-version/key-value-storage.memory
TypeScript icon, indicating that this package has built-in type declarations

9.9.14 • Public • Published

In-memory key/value storage.

Usage

import { memoryKeyValueStore } from '@zero-version/key-value-storage.memory';

const store = memoryKeyValueStore();

store.set('my-value', { some: 'value' });
console.log(store.get('my-value'));
// -> { some: 'value' }

store.set('my-value', { some: 'other-value' });
console.log(store.get('my-value'));
// -> { some: 'other-value' }

store.remove('my-value');
console.log(store.get('my-value'));
// -> undefined

Support

Are you using a package I've developed and finding it useful? Or have you looked at one of my repositories and learnt something new? If so, please consider buying me a coffee. Thanks!

Package Sidebar

Install

npm i @zero-version/key-value-storage.memory

Weekly Downloads

1

Version

9.9.14

License

UNLICENSED

Unpacked Size

2.41 kB

Total Files

5

Last publish

Collaborators

  • andrewcrobertson