Decode/encode a docker raw stream
npm install docker-raw-streamDecode/encode a docker raw stream
```
npm install docker-raw-stream

docker raw streams multiplexes stdout/stderr to a single stream
` js
var raw = require('docker-raw-stream')
var request = require('request')
var decode = raw.decode()
// forward the output to stdio
decode.stdout.pipe(process.stdout)
decode.stderr.pipe(process.stderr)
var url = 'http://docker-host:2375/containers/f7f65a63a595/attach?stderr=1&stdout=1&stream=1'
request.post(url).pipe(decode)
`
You can also use it encode a stream to the docker raw stream format
` js
var encode = raw.encode()
// forward stdin to the stdout channel
process.stdin.pipe(encode.stdout)
encode.pipe(someWritableStream)
`
Per default if you end either encode.stdout or encode.stderr the encode stream will end.raw.encode({halfOpen:true})
If you want to have the encode stream be half open use .encode.stdout
This will require both and encode.stderr` to end before the encode stream ends.
MIT