1.0.0 • Published 7 months ago
@dandre3000/is-main-thread v1.0.0
is-main-thread
Check if javascript code is running in the main thread or in a worker thread. This module is compatible with web browsers, bun, deno and node.js.
Usage
import { isMainThread } from '@dandre3000/is-main-thread'
if (isMainThread) {
// main thread
} else {
// worker thread
}
1.0.0
7 months ago