service/index.js
function Service(config, callback) {

    ld.bindAll(this);
    var eventEmitter = new EventEmitter2({ wildcard: true, delimiter: '.'});
    this.cfg = {};
    this.network = { local: eventEmitter };

    ld.defaults(this.cfg, config, {
        // id                       // required, unique service id [^a-zA-Z0-9_]
        // version                  // required
        requestTimeout: 3000,       // timeout in ms before device answer
        port: 6379,                 // network or proxy port
        host: 'paukan',             // network or proxy host
        throttling: 200,            // do not emit same event fired durning this period (on multiple psubscribe)
        connections: ['direct', 'remote', 'server'], // try next connection type if previous failed
        // - direct: connect to redis queue on specified host and port
        // - remote: connect to remote websocket proxy service on specified host and port
        // - server: create websocket server and wait incoming connection on specified port
    });

    this.id = this.cfg.id;
    this.hostname = require('os').hostname();
    this.version = this.cfg.version;
    this.description = this.cfg.description;
    this.homepage = this.cfg.homepage;
    this.author = this.cfg.author;

    this.devices = {}; // list of devices in this service
    this.log = this.createLogger(this.cfg.logger);
    if(callback) { this.init(callback); }
}
function Service(config, callback) {

    ld.bindAll(this);
    var eventEmitter = new EventEmitter2({ wildcard: true, delimiter: '.'});
    this.cfg = {};
    this.network = { local: eventEmitter };

    ld.defaults(this.cfg, config, {
        // id                       // required, unique service id [^a-zA-Z0-9_]
        // version                  // required
        requestTimeout: 3000,       // timeout in ms before device answer
        port: 6379,                 // network or proxy port
        host: 'paukan',             // network or proxy host
        throttling: 200,            // do not emit same event fired durning this period (on multiple psubscribe)
        connections: ['direct', 'remote', 'server'], // try next connection type if previous failed
        // - direct: connect to redis queue on specified host and port
        // - remote: connect to remote websocket proxy service on specified host and port
        // - server: create websocket server and wait incoming connection on specified port
    });

    this.id = this.cfg.id;
    this.hostname = require('os').hostname();
    this.version = this.cfg.version;
    this.description = this.cfg.description;
    this.homepage = this.cfg.homepage;
    this.author = this.cfg.author;

    this.devices = {}; // list of devices in this service
    this.log = this.createLogger(this.cfg.logger);
    if(callback) { this.init(callback); }
}
function Service ( config , callback ) { ld . bindAll ( this ) ; var eventEmitter = new EventEmitter2 ( { wildcard : true , delimiter : '.' } ) ; this . cfg = { } ; this . network = { local : eventEmitter } ; ld . defaults ( this . cfg , config , { // id                       // required, unique service id [^a-zA-Z0-9_] // version                  // required requestTimeout : 3000 , // timeout in ms before device answer port : 6379 , // network or proxy port host : 'paukan' , // network or proxy host throttling : 200 , // do not emit same event fired durning this period (on multiple psubscribe) connections : [ 'direct' , 'remote' , 'server' ] , // try next connection type if previous failed // - direct: connect to redis queue on specified host and port // - remote: connect to remote websocket proxy service on specified host and port // - server: create websocket server and wait incoming connection on specified port } ) ; this . id = this . cfg . id ; this . hostname = require ( 'os' ) . hostname ( ) ; this . version = this . cfg . version ; this . description = this . cfg . description ; this . homepage = this . cfg . homepage ; this . author = this . cfg . author ; this . devices = { } ; // list of devices in this service this . log = this . createLogger ( this . cfg . logger ) ; if ( callback ) { this . init ( callback ) ; } }
required fields for device 
Service - interaction interface between automated network and end devices.
Provice necessary functional and act as router.

@param {object}      config      configuration parameters for service initialisation
@param {function}    callback    if not set - only class will be instances
required fields for device Service - interaction interface between automated network and end devices . Provice necessary functional and act as router .