Answer the question
In order to leave comments, you need to log in
How to run a function in a separate process?
There is a runMe.js file where
export default async function handler(props) {
// some hard work
return someData;
}
const result = await runInAnotherProcess('./runMe.js', props)
Answer the question
In order to leave comments, you need to log in
There are Workers, they run in a separate thread (not a process) https://nodejs.org/api/worker_threads.html
You can run a separate module through child_process.fork
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question