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

245
Views
how to change the download directory/location in pipe() method?

this code downloads the files in the project folders, how do i change this to another location?

await new Promise((resolve, reject) => {
    let fileExt = post.url.split(".").pop();
    request(`${post.url}`)
      .pipe(
        fs.createWriteStream(
          `${post.title.slice(0, 10).replace(/ +/g, "")}.${fileExt}`
        )
      )
      .on("finish", () => {
        console.log("download success..!");
        resolve();
      })
      .on("error", (error) => {
        console.log("from event ===>", error);
        rejects(error);
      });
  });
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!