Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda