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

201
Vistas
Using fs.writefile to create an array of objects

I am parsing some xml and creating json objects from it.

I would like each json object to be inside an array within the file that is created by fs.writefile. Currently the output is into json objects, and I need the output to be arrays containing json objects......

Below is the code where i am creating each new json file from the xml.

Any help appreciated!

files.forEach(function (filename){
fs.writeFile('./seeds/' + filename +'.json', json, (err) => {
if (err) throw err;
console.log("FILE SAVED")
}}

Thanks

over 4 years ago · Santiago Trujillo
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