When window.run is called it should return immediately and it should should take a callback that runs when the window closed this can probably be achieved using https://github.com/nodejs/node-addon-api/blob/master/doc/async_operations.md