memlively

0.0.2 • Public • Published

memlively

Pure memory implementation of LivelyDb for doing real-time data binding of a database with local javascript objects.

Just one of multiple database implementations for the livedb real-time data-binding framework for replicating databases to local javascript objects.

build status

Installation

This module is installed via npm:

$ npm install memlively

Example Usage

var MemLively = require('memlively');

// Write to the memory database
var memdb = new MemLively();
memdb.put('my key', 'my value, function (err) {
  // I/O or other error, pass it up the callback chain
  if (err) return callback(err);
});

// Read from the memory database
memdb.get('my key', function (err, value) {
  if (err) {
    if (err.notFound) {
      // handle not found error
      return;
    } else {
      // I/O or other error, pass it up the callback chain
      return callback(err);
    }
  }
});

// Delete from the memory database
memdb.del('my key', function (err) {
  // I/O or other error, pass it up the callback chain
  if (err) return callback(err);
});

Readme

Keywords

none

Package Sidebar

Install

npm i memlively

Weekly Downloads

16

Version

0.0.2

License

BSD-3-Clause

Last publish

Collaborators

  • eugeneware