Is it possible to terminate javascript code from runing from inside an async function

i want to terminate the javascript code from runing when a specific condition is satiesfied. But the problem is that the condition is inside an async function .

we can terminate the javascript from a normal function just by throwing an error but it does not work inside an async function.

if anyone can help me on this problem, it will be very helpful for me.
thanks in advanced.