{"action":"created","issue":{"url":"https://api.github.com/repos/apocas/dockerode/issues/180","labels_url":"https://api.github.com/repos/apocas/dockerode/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/apocas/dockerode/issues/180/comments","events_url":"https://api.github.com/repos/apocas/dockerode/issues/180/events","html_url":"https://github.com/apocas/dockerode/issues/180","id":111597570,"number":180,"title":"How to just get content from output stream on buildImage","user":{"login":"christianhuening","id":738953,"avatar_url":"https://avatars.githubusercontent.com/u/738953?v=3","gravatar_id":"","url":"https://api.github.com/users/christianhuening","html_url":"https://github.com/christianhuening","followers_url":"https://api.github.com/users/christianhuening/followers","following_url":"https://api.github.com/users/christianhuening/following{/other_user}","gists_url":"https://api.github.com/users/christianhuening/gists{/gist_id}","starred_url":"https://api.github.com/users/christianhuening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianhuening/subscriptions","organizations_url":"https://api.github.com/users/christianhuening/orgs","repos_url":"https://api.github.com/users/christianhuening/repos","events_url":"https://api.github.com/users/christianhuening/events{/privacy}","received_events_url":"https://api.github.com/users/christianhuening/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-15T11:26:48Z","updated_at":"2015-10-15T14:54:42Z","closed_at":null,"body":"Hi,\r\n\r\nI am using docker.buildImage and I'd like to use the string content from the output stream. \r\n\r\nHere's my code:\r\n```javascript\r\ndocker.buildImage(tarPackageName, {\r\n            t: imageName+':latest'\r\n          }, function(error, output) {\r\n\r\n            if(error) return res.json(500,error);\r\n\r\n            output.on('data', function(data){\r\n              console.log(data.toString());\r\n            });\r\n\r\n            output.on('end',function(){\r\n              res.status(200).json('ImageCreated');\r\n            });\r\n});\r\n```\r\n\r\nHowever the string content from the stream looks like this:\r\n```\r\n{\"stream\":\" ---\\u003e Using cache\\n\"} \r\n```\r\nIs there any way to just use the content of the \"stream\" field (e.g.: \"Using cache\\n\")? \r\nI already tried to call data.stream.toString(). \r\nI have to admit that I am new to JS Streams. I read the docs, but maybe I am getting something wrong here?\r\n\r\nCheers,\r\nChristian"},"comment":{"url":"https://api.github.com/repos/apocas/dockerode/issues/comments/148410711","html_url":"https://github.com/apocas/dockerode/issues/180#issuecomment-148410711","issue_url":"https://api.github.com/repos/apocas/dockerode/issues/180","id":148410711,"user":{"login":"rmg","id":17978,"avatar_url":"https://avatars.githubusercontent.com/u/17978?v=3","gravatar_id":"","url":"https://api.github.com/users/rmg","html_url":"https://github.com/rmg","followers_url":"https://api.github.com/users/rmg/followers","following_url":"https://api.github.com/users/rmg/following{/other_user}","gists_url":"https://api.github.com/users/rmg/gists{/gist_id}","starred_url":"https://api.github.com/users/rmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmg/subscriptions","organizations_url":"https://api.github.com/users/rmg/orgs","repos_url":"https://api.github.com/users/rmg/repos","events_url":"https://api.github.com/users/rmg/events{/privacy}","received_events_url":"https://api.github.com/users/rmg/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T14:54:42Z","updated_at":"2015-10-15T14:54:42Z","body":"Take a look at the [helper functions](https://github.com/apocas/dockerode#helper-functions). I think one of them should work for what you want to do. "}}