Some libraries exposes two methods that essentialy does the same thing, but one of them runs in async context and the other in sync context.
Some examples are: unlink
from fs/promises
and unlinkSync
from fs
; compare
, compareSync
, hash
and hashSync
from bcrypt.
Why did they choose to do this? Is there any pros and cons of using sync or async depending on the context of my application?