Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!