Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including skiff-client with all npm packages installed. Try it out:

var skiffClient = require("skiff-client")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

skiff-client v0.7.0

Client for Skiff - Implementation of the Raft consensus algorithm in Node.js


Build Status Dependency Status

Client for Skiff (Node.js implementation of the Raft algorithm).

  • Persistence: LevelDB
  • Protocol: Msgpack over TCP


$ npm install skiff-client


var SkiffClient = require('skiff-client');
var node = SkiffClient('tcp+msgpack://localhost:8081');

or, with options:

var options {
  // ...

var node = SkiffClient('tcp+msgpack://localhost:8081', options);


  • autoListen: start listening on bootup. defaults to true.
  • transport: transport type. Supported values:
    • tcp-msgpack: Msgpack over TCP (default)
    • tcp-nlsjson: New-line separated JSON over TCP
  • dbPath: database path
  • waitLeaderTimeout: the time to wait to become a leader. defaults to 3000 (ms).


A skiff client object implements the level-up API.

You can also extend the client with level-* plugins, including sublevel.

Other than that, you can:


Listen for nodes connecting to us.

.join(url, cb)

Joins a node given its URL.

.leave(url, cb)

Leaves a node given its URL.



RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free