Closed GNUGradyn closed 1 year ago
I believe this was intentional. This library used to be completely synchronous (which is why I made asar-async), but it was very frustrating because your entire program would have to stop until the package was finished, which took up way more time than it needed to. I'd suggest you look into async functions and promises, since that will provide a similar programming style to synchronous calls.
Here's some good documentation on it: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
Typically, when I'm writing a one-off script and need something to be synchronous when it's not, I'll use an IIFE (immediately-invoking function expression). Here's what it looks like:
(async () => {
// Your code goes here
const myThing = await anAsyncFunction();
console.log(myThing);
})();
Hi! I noticed asar.createPackage is a couroutine. I need to synchronously create a package programatically?