Using node worker_threads on server

I’m looking to use worker threads to do some batch processing and still have the main node thread be responsive so it does not block the main thread. I was wondering if there are any hints on how to do this with the latest node version. I read the docs on web_workers. The entry point requires specifying a .js file to run. Meteor does a bunch of packaging for the source files. Is there any file entry point I can use to access server side code so I can run some functions as worker_threads?

All the articles I read were dated (pre web_worker support in node)

It’s the same issue with service workers. Meteor doesn’t support having the multiple entry points this would require unfortunately. But you could create a worker as a standalone in the private/ directory and import it there.