Zen
The Riak way to enlightenment
Install
$ npm install zen.js
API
zen.use([url, options])
Sets Riak's url and optionally specifies protocol (http or protobuf)
zen // default to http://localhost:8098 zen zen zen
zen.listBuckets()
Gets a list of buckets from the database
WARNING: This function should not be used in production environment because it consumes a lot of memory
zen;
zen.getBucket(bucket, [headers], callback)
Gets properties for the specified bucket
zen; zen;
zen.setBucket(bucket, props, [headers], callback)
Sets properties for the specified bucket
zen; zen;
zen.store(bucket, [key], object, [options], [callback])
Stores an object in the database
zen; zen; zen;
zen.fetch(bucket, key, [headers], callback)
Fetches an object from the database
zen;
zen.delete(bucket, key, [headers]], callback)
Deletes an object from the database
zen;
zen.ping(callback)
Checks if database is online
zen;
zen.status(callback)
Returns Riak's performance and configuration datas
WARNING: it requires riak_kv_stat
to be enabled
zenstatus { console // {....}};
Tests
Tests are written with Mocha
$ npm test
License
MIT (see LICENSE
)
To Do
- Protobuf APIs