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

417
Vistas
How can I convert a LOG .txt to .json using JavaScript?

I'd like to know how can i convert a log to .Json using JS. Reading the data in the LOG and converting it to .json, i searched a lot and didnt find anything about it.

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

0

You can simply read from the .txt file then write the contents to a .json file using JSON.stringify to make sure characters such as newlines and double quotes are escaped properly.

For example using Node.js:

const fs = require('fs');
const contents = fs.readFileSync('log.txt', 'utf8');
fs.writeFileSync('log.json', `{ "data": ${JSON.stringify(contents)} }\n`);
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