I am writing my very first command line tool with node.js. I'm familiar with the concept of async io and understand the benefits of using it. I am wondering however, since this tool will do the following:
- Perform some FS operations (e.g. create folder, write to some files)
- Make a network request (e.g. download some stuff into this folder)
- Produce a result (meaning a bunch of files)
- Exit
Should I really be using all the async versions for these methods? for instance mkdirp()
is also available as mkdirpSync()
(from the fs-extra
module), so the real question is:
Why do I even have to bother using async functions in a program that is due to terminate upon completion? and has no real impact in case the application thread is blocked?
Thanks.
Aucun commentaire:
Enregistrer un commentaire