kevast-memory
v0.2.4
Published
Memory storage for kevast.js
Downloads
8
Maintainers
Readme
kevast-memory.js
A memory storage for kevast.js.
Installation
Node.js
Using yarn
yarn add kevast-memory
Using npm
npm install kevast-memory
Browser
<script src="https://cdn.jsdelivr.net/npm/kevast-memory/dist/kevast-memory.min.js"></script>
Usage
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');
})();