mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
530 B
530 B
name
| name |
|---|
| Check if the current file is the entrypoint |
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.
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.