A simple in-memory database that can be used as a module or interacted as a stdin - stdout CLI application.
npm install
node bin/remdb
node bin/remdb < test/test_cli_1.txt
npm install
Then in your file:
var Remdb = require('../lib/remdb');
var remdb = new Remdb();
remdb.SET('a', 10);
var aVal = remdb.GET('a');
Sets the key to value.
remdb.SET('a', 10);
Get the value of key. If key has not yet been set, will return NULL.
remdb.GET('a');
Unsets the key's value, it will become null.
remdb.UNSET('a');
Get number of keys that are currently set to value.
remdb.NUMEQUALTO(10);
[Module] Clears the database. Only available when included as a module.
remdb.CLEAR();
[CLI] Exits remdb. Only available in CLI.
Open a new transaction block. Transaction blocks can be nested.
remdb.BEGIN();
Collapse latest transaction block (undo what was set after the latest BEGIN).
remdb.ROLLBACK();
Apply and collapse all transaction blocks.
remdb.COMMIT();
Tests are located in test/test.js and uses Mocha with Chai.
npm install
npm test