Electron - Run JavaScript in the Background



I have some JavaScript that executes a longer running process. This JavaScript is necessary, at the same time, its currently negatively impacting my UI. I started looking into Web Workers, however i learned that Electron does not fully support web workers.

In my case, I’m trying to use Node’s fs module in a web worker to process a file and write some new ones. However, as shown in the GitHub issue referenced above, this approach will not work. My question is, what other approaches would individuals recommend to overcome this challenge?



The other approach is covered in that very same issue, spawn a separate process to do the work.