
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
docker-events
Advanced tools
Create an event emitter from dockerode's events response
Docker exposes an event API, allowing one to monitor the happenings of a Docker host. dockerode allows for consumption of this API, albeit in a very raw form. docker-events does a bit of work for you, turning the raw API of dockerode into something a little more high-level by parsing the response stream and pushing things out of an EventEmitter.
var emitter = new DockerEvents({
docker: new Dockerode(options),
});
emitter.start();
emitter.stop();
emitter.on("connect", function() {
console.log("connected to docker api");
});
emitter.on("disconnect", function() {
console.log("disconnected to docker api; reconnecting");
});
emitter.on("_message", function(message) {
console.log("got a message from docker: %j", message);
});
emitter.on("create", function(message) {
console.log("container created: %j", message);
});
emitter.on("start", function(message) {
console.log("container started: %j", message);
});
emitter.on("stop", function(message) {
console.log("container stopped: %j", message);
});
emitter.on("die", function(message) {
console.log("container died: %j", message);
});
emitter.on("destroy", function(message) {
console.log("container destroyed: %j", message);
});
3-clause BSD. A copy is included with the source.
FAQs
Create an event emitter from dockerode's events response
We found that docker-events demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.