Skip to content

Check if javascript code is running in the main thread or in a worker thread.

License

dandre3000/is-main-thread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

Check if javascript code is running in the main thread or in a worker thread.

Resources

License

Stars

Watchers

Forks

Packages

No packages published