[Runtime
](../../../index.md)[Package Manager
](../../../pm/cli/install/index.md)[Bundler
](../../../bundler/index.md)[Test Runner
](../../../test/index.md)[Guides
](../../index.md)[Reference
](https://bun.com/reference)[Blog
](https://bun.com/blog)[Feedback
](../../../feedback/index.md)
Bun provides a handful of module-specific utilities on the import.meta object. Use import.meta.main to check if the current file is the entrypoint of the current process.
index.ts
if (import.meta.main) {
// this file is directly executed with `bun run`
} else {
// this file is being imported by another file
}
See Docs > API > import.meta for complete documentation.
Was this page helpful?
[
Get the absolute path of the current file
Previous
](../import-meta-path/index.md)[
Get the absolute path to the current entrypoint
Next
](../main/index.md)