Skip to content

dockerera/nodejs-docker-connect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-docker-connect

Create an event emitter from dockerode's events response

Overview

Turning the raw event response of dockerode into something a little more easy to handle docker connect defines some emitter events for you.

DockerEvents (constructor)

var emitter = new DockerEvents({
  docker: new Dockerode(options),
});

start

emitter.start();

stop

emitter.stop();

events

connect disconnect

#connect

emitter.on("connect", function() {
  console.log("connected to docker api");
});

#disconnect

emitter.on("disconnect", function() {
  console.log("disconnected to docker api; reconnecting");
});

#_message

emitter.on("_message", function(message) {
  console.log("got a message from docker: %j", message);
});

#create

emitter.on("create", function(message) {
  console.log("container created: %j", message);
});

#start

emitter.on("start", function(message) {
  console.log("container started: %j", message);
});

#stop

emitter.on("stop", function(message) {
  console.log("container stopped: %j", message);
});

#die

emitter.on("die", function(message) {
  console.log("container died: %j", message);
});

#destroy

emitter.on("destroy", function(message) {
  console.log("container destroyed: %j", message);
});

Contact

About

Create an event emitter from dockerode's events response

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%