dockerode-process
Advanced tools
Comparing version 0.3.1 to 0.4.0
{ | ||
"name": "dockerode-process", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "ChildProcess like interface for docker containers", | ||
@@ -27,11 +27,12 @@ "main": "docker_process.js", | ||
"dependencies": { | ||
"dockerode-promise": "0.0.1", | ||
"promise": "~3.2.0" | ||
"dockerode-promise": "0.0.1", | ||
"promise": "~3.2.0", | ||
"debug": "0.8.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.17.1", | ||
"dockerode-options": "~0.1.0", | ||
"dockerode-promise": "0.0.1", | ||
"mocha-as-promised": "~2.0.0" | ||
"dockerode-options": "~0.1.0", | ||
"dockerode-promise": "0.0.1", | ||
"mocha-as-promised": "~2.0.0" | ||
} | ||
} |
18
utils.js
@@ -7,2 +7,3 @@ var Promise = require('promise'); | ||
stream.Transform.apply(this, arguments); | ||
this.__layerStarts = {}; | ||
} | ||
@@ -26,8 +27,19 @@ | ||
if (json.progress) str += ' ' + json.progress; | ||
str += '\n'; | ||
str += '\r\n'; | ||
this.push(str); | ||
if (json.status == 'Downloading') { | ||
if (this.__layerStarts[json.id] === undefined) { | ||
this.__layerStarts[json.id] = new Date(); | ||
} | ||
} else if (json.status == 'Download complete') { | ||
if (this.__layerStarts[json.id] !== undefined) { | ||
var s = Math.abs(new Date() - this.__layerStarts[json.id]) / 1000; | ||
this.push(json.id + ' - Downloaded in ' + s + ' seconds\r\n'); | ||
} | ||
} | ||
return done(); | ||
} | ||
this.push(json.status + '\n'); | ||
this.push(json.status + '\r\n'); | ||
done(); | ||
@@ -104,3 +116,3 @@ } | ||
// image is missing so pull it | ||
docker.pull(image).then(function(rawPullStream) { | ||
return docker.pull(image).then(function(rawPullStream) { | ||
rawPullStream.pipe(pullStream); | ||
@@ -107,0 +119,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23783
13
490
3
+ Addeddebug@0.8.0
+ Addeddebug@0.8.0(transitive)