SimpleKeeper
Zookeeper-like distributed server, WIP.
Installation
Via npm on Node:
npm install simplekeeper
Usage
Reference in your program:
var simplekeeper = ;
In the current version (0.0.1) only local server is implemented, with two flavors: synchronous and asynchronous.
Synchronous Server
Create a server
var server = simplekeeper;
Get value
var value = simplekeeper;
Return null if path does not exist.
Set value
simplekeeper;simplekeeper;
Get children
var names = simplekeeper; // ['name', 'age']
Delete node (and its children, if any)
simplekeeper;
Exists node
simplekeeper; // false after deletoin
Invalid path (throws exceptions)
simplekeeper; // nullsimplekeeper; // not a stringsimplekeeper; // empty stringsimplekeeper; // it does not start with /
Asynchronous Server
Create a server
var server = simplekeeper;
Its functions are the same of a synchronous server, but with a callback. I.e.: Get Value
var value = simplekeeper;
Development
git clone git://github.com/ajlopez/SimpleKeeper.git
cd SimpleKeeper
npm install
npm test
Samples
TBD
To do
- Samples
- Set Leader
- Distributed Server
- Invalid path when it ends with /
Versions
- 0.0.1: Published
Contribution
Feel free to file issues and submit pull requests � contributions are welcome.
If you submit a pull request, please be sure to add or update corresponding
test cases, and ensure that npm test
continues to pass.