Hacker News new | past | comments | ask | show | jobs | submit login

It really should be:

   try{
        x = await fs.writeFilePromise("Hello, World", "helloworld.txt")
        console.log("done!")
   }
   catch(error)
   {
        console.error(error) // or console.log
   }
This takes advantage of promises fully.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: