1.0.1 • Published 7 years ago

docker-stream-cleanser v1.0.1

Weekly downloads
39
License
MIT
Repository
github
Last release
7 years ago

NPM

Build Status

Docker Stream Cleanser

Docker Stream Cleanser is a drop-in module to clean the headers from Docker Logs (container attach or container logs)

  • Removes headers from a Docker logs streams and keeps payload
  • Handles any encoding (Ones compatible with Node.js Buffer)

Seeing weird characters at the beginning of each line coming from your Docker container's log stream? This will clear that right up! Docker places a header on each message to help you determine which stream (stdout or stderr) a message should belong to. Thanks Docker, but I just want to read the output! Since there is no setting to turn off this functionality, I wrote this.

More info on Docker's Container Logs

Usage

Usage with Docker Data Stream

const StreamCleanser = require('docker-stream-cleanser');
const streamCleanser = new StreamCleanser()
dockerLogStream
  .pipe(streamCleanser)
  .pipe(/* stream */);

Usage with Dockerode

const Docker = require('dockerode');
const container = new Docker().getContainer(containerId);

const StreamCleanser = require('docker-stream-cleanser');
const streamCleanser = new StreamCleanser()

container.logs({ stderr: true, stdout: true }, function (err, stream) {
  stream
    .pipe(streamCleanser)
    .pipe(/* stream */);
});

Installation

npm install docker-stream-cleanser --save

License

MIT

1.0.1

7 years ago

1.0.0

7 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago