Comparing version 0.9.4 to 0.9.5
@@ -1,11 +0,1 @@ | ||
String.prototype.isJson = function() { | ||
try { | ||
JSON.parse(this); | ||
} catch (e) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
var Endpoint = require('./endpoint'), | ||
@@ -32,2 +22,3 @@ Modem = require('docker-modem'), | ||
return { | ||
demuxStream: modem.demuxStream; | ||
containers: { | ||
@@ -34,0 +25,0 @@ list: new Endpoint('options', { |
{ | ||
"name": "docker.io", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"description": "wrapper for the docker.io REST interface", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -52,2 +52,22 @@ docker.io | ||
### API calls (w/streams) | ||
```javascript | ||
//tty:true | ||
docker.containers.attach('hi74y2i34yi23', {stream: true, stdout: true, stderr: true, tty: true}, function(err, stream) { | ||
stream.pipe(process.stdout); | ||
}); | ||
//tty:false | ||
docker.containers.attach('hi74y2i34yi23', ({stream: true, stdout: true, stderr: true, tty: false}, function(err, stream) { | ||
//http://docs.docker.io/en/latest/api/docker_remote_api_v1.7/#post--containers-(id)-attach | ||
//dockerode may demultiplex the streams for you :) | ||
container.modem.demuxStream(stream, process.stdout, process.stderr); | ||
}); | ||
docker.image.create({fromImage: 'ubuntu'}, function(err, stream) { | ||
stream.pipe(process.stdout); | ||
}); | ||
``` | ||
## Contributing | ||
@@ -54,0 +74,0 @@ |
48712
108
634