Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

103
Vistas
Remove control characters from UNIX Domain Socket

i have a problem with docker exec command output, when i try to run (with got)

 const output = await client.runCommand([
      "cat -v ./tmp/schema.json"
  ]); 

Where runCommand return a stream with docker socket of exec command

    return new Promise((resolve, reject) => {
      let chunks = [];

      stream.on("data", (chunk) => { 
        let output = chunk.toString();
        chunks.push(output);
      });

      stream.on("error", (err) => reject(err));
      stream.on("end", () => resolve(chunks.join("")));
    });

but when i parse with json parse the result of this promise i receive this control characters

screen

is possible to remove this control characters from the chunks?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you can check and replace if the chunk contains any UNIX control character

chunk.replaceAll(/[\u0000-\u001F\u007F-\u009F]/g, "")
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda