Why is all of my output appearing before each brute-force attempt when attempting to crack an ethereum keystore wallet file in node.js

I found a post describing how to recover an Ethereum wallet keystore by guessing a single password, however, it uses node synchronous code, and I’m trying to convert it into asynchronous code so that I can use multithreading using worker_threads.