lib/index.js
function updateContainers(next) {
    monitor.docker.listContainers(function(err, list) {
      if (err) {
        console.log('Error listing running containers: %s', err.message, err);
        return next(err);
      }

      if (!monitor.started) {
        if (handler.onMonitorStarted) {
          handler.onMonitorStarted(monitor, monitor.docker);
        }
        monitor.started = true;
      }

      list.forEach(function(it) {
        var info = clone(it);
        info.Name = getContainerName(it.Names);

        updateContainer(info);
      });

      next();
    });
  }
function updateContainers(next) {
    monitor.docker.listContainers(function(err, list) {
      if (err) {
        console.log('Error listing running containers: %s', err.message, err);
        return next(err);
      }

      if (!monitor.started) {
        if (handler.onMonitorStarted) {
          handler.onMonitorStarted(monitor, monitor.docker);
        }
        monitor.started = true;
      }

      list.forEach(function(it) {
        var info = clone(it);
        info.Name = getContainerName(it.Names);

        updateContainer(info);
      });

      next();
    });
  }
function updateContainers ( next ) { monitor . docker . listContainers ( function ( err , list ) { if ( err ) { console . log ( 'Error listing running containers: %s' , err . message , err ) ; return next ( err ) ; } if ( ! monitor . started ) { if ( handler . onMonitorStarted ) { handler . onMonitorStarted ( monitor , monitor . docker ) ; } monitor . started = true ; } list . forEach ( function ( it ) { var info = clone ( it ) ; info . Name = getContainerName ( it . Names ) ; updateContainer ( info ) ; } ) ; next ( ) ; } ) ; }
initially populate container map
initially populate container map