Gazel

A high performance key/value store for the browser modeled after Redis.

If you like living on the bleeding edge, grab the latest build from GitHub.

curl https://raw.github.com/matthewp/gazel/master/build/gazel.min.js > gazel.min.js
Execute

Fee: 0

var client = gazel.createClient();

client.on('error', function(err) {
  alert('Oh noes!');
});

client.set('Foo', 'bar', gazel.print);

client.multi()
  .set('Fee', 1)
  .set('Fi', 2)
  .set('Fo', 3)
  .set('Fum', 4)
  .incrby('Fee', 10)
  .get('Fee')
  .exec(function(results) {
    var fee = results.pop()[0];

    document.getElementById('fee').textContent = fee;
  });

get

Get the value of a key.

  • key: String key.
  • callback: Function callback in case of success. Argument is the key's value.

set

Set the value of a key.

  • key: String key.
  • value: Object value being set.
  • callback: Function callback in case of success. Includes one argument, which should always have the value of OK.

del

Delete a key, or series of keys.

  • key(s): String key, or a series of arguments for multiple string keys.
  • callback: Function callback in case of success. Argument includes the number of keys deleted.

incr

Increment a key by 1. They key's value must be an integer. If the key does not exist, it will be created and assigned the value of 1.

  • key: String key
  • callback: Function callback in case of success.

incrby

Increment a key by a given increment. They key's value must be an integer. If the key does not exist, it will be created and assigned the value of increment.

  • key: String key.
  • increment: Number to add to current value.
  • callback: Function callback in case of success.

decr

Decrement a key by a value of 1. The key's value must be an integer. If the key does not exist, it will be created with a value of -1.

  • key: String key.
  • callback: Function callback in case of success.

decrby

Decrement a key by a given decrement. The key's value must be an integer. If the key does not exist, it will be created with a value of decrement.

  • key: String key
  • decrement: Number to subtract from teh current value.
  • callback: Function callback in case of success.

multi

Initiate the start of a chaining operation.

exec

Execute a chain of commands.

  • callback: Function callback in case of success. Called when chaining is complete, fed a results array, containing arrays of all of the results.

discard

Abort a transaction in process.

  • callback: Function callback, called after discarding the transactions in process.