docs: function HumixSenseModule(config, logger) {
  
  
      var self = this;
      EventEmitter.call(this);
      self.config = config;
      self.logger = logger;
      self.name = config.moduleName;
  
      // Register Command Callback
      var cmdPrefix = 'humix.sense.' + config.moduleName + '.command';
  
      for (var i in config.commands) {
  
          var command = config.commands[i];
          var topic = cmdPrefix + '.' + command;
          self.logger.debug('subscribing command topic:' + topic);
          (function (topic, command) {
  
              nats.subscribe(topic, function (data, replyTo) {
                  self.logger.debug('emitting command topic:' + topic);
                  var parsedData;
                  if (data) {
                      try {
                          parsedData = JSON.parse(data);
                      }
                      catch (e) {
                          parsedData=data;
                      }
                  }
                  if (parsedData instanceof Object && parsedData.syncCmdId) {
  
                      delete parsedData.syncCmdId;
                      self.emit(command, JSON.stringify(parsedData), function (result) {
  
                          nats.publish(replyTo, result);
                      });
                  }
                  else {
  
                      self.emit(command, data);
                  }
              });
          })(topic, command);
      }
  
  
      var localEventPrefix = 'humix.sense.localEvent.';
      for (var i in config.localEvents) {
          var localEvent = config.localEvents[i];
          var topic = localEventPrefix  + localEvent;
  
          (function (topic, localEvent) {
  
              nats.subscribe(topic, function (data, replyTo) {
                  self.logger.info('emitting command topic:' + topic);
                  var parsedData ;
                    if (data && typeof data === 'object') {
                      try {
                          data = JSON.parse(data);
                      }
                      catch (e) {
                         self.logger.error('failed to parse data');
                      }
                  }
  
  
                  localEventEmitter.emit(localEvent, data);
  
              });
          })(topic, localEvent);
      }
      // Child Process management
      // if child process is defined in the config file, start child process here
  
      if (config.childProcess) {
  
          var respawn = require('respawn');
  
          var process_option = {
  
              maxRestarts: 0
          }
  
          var exec_commands = [
              config.childProcess.name,
              config.childProcess.params
          ];
  
          var monitor = respawn(exec_commands, { maxRestarts: config.childProcess.restart });
  
          self.logger.debug('launch child process: name:' + config.childProcess.name + ', param:' + config.childProcess.params + ', restart:' + config.childProcess.restart);
  
          monitor.start();
  
          monitor.on('stdout', function (data) {
              self.emit('stdout', data);
              self.logger.info('process monitor:' + data);
          });
  
          monitor.on('stderr', function (data) {
  
              self.logger.error('process monitor:' + data);
          });
  
          monitor.on('exit', function (code) {
  
              self.emit('childClose', code);
              self.logger.info('child process exited with code ' + code);
          });
  
      }
  
  }