Sync vs. async in JavaScript is quite a hassle especially if you are writing APIs to be used by others. There are tools (*) that let you write “universal” code but even there, you can’t call async code within sync code.
(*) github.com/quansync-dev...
github.com
GitHub - quansync-dev/quansync: "Superposition" between sync and async
"Superposition" between sync and async. Contribute to quansync-dev/quansync development by creating an account on GitHub.