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

212
Visualizações
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 à 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