aldrin312 / AutoCommentingTool

BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Using async for writeFile #4

Closed fadingNA closed 2 months ago

fadingNA commented 2 months ago

https://github.com/aldrin312/AutoCommentingTool/blob/0a92be444b052f54d79ada889570c9e01a54b887/index.js#L47

using asynchonous to dealing with file even read or load, better because you can use async with error handling, easier for debug and not crash the application

aldrin312 commented 2 months ago

Fixed! asynced the writeIntoFile function.

fadingNA commented 2 months ago

@aldrin312 You may wan to


try{
  // processing file 

  return . 
}catch(err)
 console.error(`Error from write file ${err} ...`
 return .. 

you might wrap it with try catch block better for debug