Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!