worker.terminate()


尽快停止工作线程中的所有 JavaScript 执行。返回一个退出代码的 Promise,当 'exit' 事件 被触发时该 Promise 会被履行。

【Stop all JavaScript execution in the worker thread as soon as possible. Returns a Promise for the exit code that is fulfilled when the 'exit' event is emitted.】