import.meta object. Use import.meta.main to check if the current file is the entrypoint of the current process. See Docs > API > import.meta for complete documentation.
import.meta object. Use import.meta.main to check if the current file is the entrypoint of the current process. if (import.meta.main) { // this file is directly executed with `bun run` } else { // this file is being imported by another file } Was this page helpful?