New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simplekeeper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplekeeper

Zookeeper-like distributed server, WIP

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

SimpleKeeper

Zookeeper-like distributed server, WIP.

Installation

Via npm on Node:

npm install simplekeeper

Usage

Reference in your program:

var simplekeeper = require('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.createSyncServer('simplekeeper');

Get value

var value = simplekeeper.getValue('/user/1/name');

Return null if path does not exist.

Set value

simplekeeper.setValue('/user/1/name', 'adam');
simplekeeper.setValue('/user/1/age', 800);

Get children

var names = simplekeeper.getChildren('/user/1'); // ['name', 'age']

Delete node (and its children, if any)

simplekeeper.delete('/user/1');

Exists node

simplekeeper.exists('/user/1'); // false after deletoin

Invalid path (throws exceptions)

simplekeeper.getValue(null);   // null
simplekeeper.getValue(123);    // not a string
simplekeeper.getValue('');     // empty string
simplekeeper.getValue('foo');  // it does not start with /

Asynchronous Server

Create a server

var server = simplekeeper.createServer('simplekeeper');

Its functions are the same of a synchronous server, but with a callback. I.e.: Get Value

var value = simplekeeper.getValue('/user/1/name', function (err, value) { ... } );

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.

Keywords

zookeeper

FAQs

Package last updated on 31 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts