novus-component-store-memory

0.0.1 • Public • Published

novus-component-store-memory

In-memory key/value store for novus-component. This module is included by default when npm installing the novus-component@>=2.1.0 module.

Despite the fact that it was designed to be used by novus-component, you can install and use this module independently if so desired.

Usage

Install using npm:

npm i novus-component-store-memory

Setting it up:

import { MemoryStore } from 'novus-component-store-memory';
 
const store = new MemoryStore();

Getting a key:

// MemoryStore.get(key, def = null)
let value = store.get('key', false);
// 'value' is false if there was no such key found

Setting a key:

// MemoryStore.set(key, value, override = true)
store.set('key', 'value');

License

Copyright 2016 Michiel van der Velde.

This software is licensed under the MIT License

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i novus-component-store-memory

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • michielvdvelde