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

211
Vistas
Convert plain text to .yml in javascript and return it

Im creating a file upload system which sends a string to my api made with express. I am trying to make the api take the string and create a yml file and return the created yml.

Currently I have

fs.writeFileSync('temp.yml', file);
const actualFile = fs.readFileSync('./temp.yml', 'utf8');
const data = fs.createReadStream('./temp.yml');
// delete file fs.unlinkSync('./temp.yml');
return data;

While this gets the job done, I dont believe its the best way. How can I return the read stream or the file without creating a file in the directory? Thanks Create+Read+Stream+without+creating+file+javascript

about 4 years ago · Juan Pablo Isaza
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