Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docker-stream-cleanser

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docker-stream-cleanser

This module cleans the docker headers from the log stream from a container. I never found them very useful, so I wrote this to clean them up either in bulk, or in between a piping. It's not as simple as just removing the first 8 bytes on every message

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26
increased by420%
Maintainers
2
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 06 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc