var Docker = require('../lib/docker');
var fs     = require('fs');

var socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock';
var stats  = fs.statSync(socket);

if (!stats.isSocket()) {
  throw new Error('Are you sure the docker is running?');
}

var docker = new Docker({ socketPath: socket });

docker.listContainers({all: true}, function(err, containers) {
  console.log('ALL: ' + containers.length);
});

docker.listContainers({all: false}, function(err, containers) {
  console.log('!ALL: ' + containers.length);
});

@@ -503,28 +503,270 @@
 ' + containers.length);%0A%7D);%0A
+%0A// filter by labels%0Avar opts = %7B%0A  %22limit%22: 3,%0A  %22filters%22: '%7B%22label%22: %5B%22staging%22,%22env=green%22%5D%7D'%0A%7D;%0A%0Adocker.listContainers(opts, function(err, containers) %7B%0A  console.log('Containers labeled staging + env=green : ' + containers.length);%0A%7D);%0A

add filter by label string example