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

164
Views
console.log displays a strange … triple dot as one character character

I am using xmlbuilder2 and noticed something strange when I console.log the output. The following code will produce a reasonably large xml string but when logged it will remove a large part of the xml from the middle, replacing it with what looks like three dots ... but is actually one character … and repeat that character at the end.

The stranger thing is that when I use VSC's Debug Console to print the output I get the perfectly constructed xml.

const output = doc.end({ prettyPrint: true });
console.log(output);

Example:

<TXLife><MoreTags>5Y10-XA…<FormName><MoreTags></TXLife>…

Any thoughts on why this happens?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use:

process.stdout.write(output + '\n');

instead.

console.log truncates data that is too long (I'm not sure what the max length of data can be before it truncates.

This happens because console.log uses util.inspect which produces output intended for debugging.

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!