dist/index.js
function init() {
  var _user = arguments.length <= 0 || arguments[0] === undefined ? 'try' : arguments[0];

  var _pw = arguments.length <= 1 || arguments[1] === undefined ? 'try' : arguments[1];

  var _clientId = arguments.length <= 2 || arguments[2] === undefined ? 'mqttControlsClient' : arguments[2];

  var _broker = arguments.length <= 3 || arguments[3] === undefined ? 'broker.shiftr.io' : arguments[3];

  var _topics = arguments.length <= 4 || arguments[4] === undefined ? {
    'subscribe': '/output/#',
    'publish': '/input/' } : arguments[4];

  user = _user;
  pw = _pw;
  clientId = _clientId;
  broker = _broker;
  topics = _topics;
  url = '' + protocol + user + ':' + pw + '@' + broker;
  console.log('mqtt controller is initialised');
}
function init() {
  var _user = arguments.length <= 0 || arguments[0] === undefined ? 'try' : arguments[0];

  var _pw = arguments.length <= 1 || arguments[1] === undefined ? 'try' : arguments[1];

  var _clientId = arguments.length <= 2 || arguments[2] === undefined ? 'mqttControlsClient' : arguments[2];

  var _broker = arguments.length <= 3 || arguments[3] === undefined ? 'broker.shiftr.io' : arguments[3];

  var _topics = arguments.length <= 4 || arguments[4] === undefined ? {
    'subscribe': '/output/#',
    'publish': '/input/' } : arguments[4];

  user = _user;
  pw = _pw;
  clientId = _clientId;
  broker = _broker;
  topics = _topics;
  url = '' + protocol + user + ':' + pw + '@' + broker;
  console.log('mqtt controller is initialised');
}
function init ( ) { var _user = arguments . length <= 0 || arguments [ 0 ] === undefined ? 'try' : arguments [ 0 ] ; var _pw = arguments . length <= 1 || arguments [ 1 ] === undefined ? 'try' : arguments [ 1 ] ; var _clientId = arguments . length <= 2 || arguments [ 2 ] === undefined ? 'mqttControlsClient' : arguments [ 2 ] ; var _broker = arguments . length <= 3 || arguments [ 3 ] === undefined ? 'broker.shiftr.io' : arguments [ 3 ] ; var _topics = arguments . length <= 4 || arguments [ 4 ] === undefined ? { 'subscribe' : '/output/#' , 'publish' : '/input/' } : arguments [ 4 ] ; user = _user ; pw = _pw ; clientId = _clientId ; broker = _broker ; topics = _topics ; url = '' + protocol + user + ':' + pw + '@' + broker ; console . log ( 'mqtt controller is initialised' ) ; }
export var url = url; export var topics = topics; export var isSubscribed = isSubscribed; export var isPublishing = isPublishing; export var stopPub = stopPub; export var protocol = protocol; export var broker = broker; export var user = user; export var pw = pw; export var clientId =  clientId; 
init  Initialize the library
@param  {String} _user     The user name at your broker. Default: try
@param  {String} _pw       The password at your broker. Default: try
@param  {String} _clientId The name you want to be displayed with: Default: mqttControlsClient
@param  {String} _broker   The borker to connect to. Default: brker.shiftr.io
@param  {Object} _topics   Topics to subscribe and th publish to. Currently one one per publish and subscribe. Default `{'subscribe':'/output/#','publih':'/input/'}`
export var url = url ; export var topics = topics ; export var isSubscribed = isSubscribed ; export var isPublishing = isPublishing ; export var stopPub = stopPub ; export var protocol = protocol ; export var broker = broker ; export var user = user ; export var pw = pw ; export var clientId = clientId ; init Initialize the library