A memory storage for kevast.js.
Using yarn
yarn add kevast-memory
Using npm
npm install kevast-memory
<script src="https://cdn.jsdelivr.net/npm/kevast-memory/dist/kevast-memory.min.js"></script>
const { Kevast } = require('kevast');
const { KevastMemory } = require('kevast-memory');
const assert = require('assert');
(async () => {
const kevast = new Kevast(new KevastMemory());
await kevast.set('key', 'value');
assert(await kevast.get('key') === 'value');
})();
Specify Map:
const { Kevast } = require('kevast');
const { KevastMemory } = require('kevast-memory');
const assert = require('assert');
(async () => {
const map = new Map();
const kevast = new Kevast(new KevastMemory(map));
await kevast.set('key', 'value');
assert(map.get('key') === 'value');
})();