mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
fix(docs): update formatting (#5685)
This commit is contained in:
@@ -5,9 +5,9 @@ name: Check if the current file is the entrypoint
|
||||
Bun provides a handful of module-specific utilities on the [`import.meta`](/docs/api/import-meta) object. Use `import.meta.main` to check if the current file is the entrypoint of the current process.
|
||||
|
||||
```ts#index.ts
|
||||
if(import.meta.main){
|
||||
if (import.meta.main) {
|
||||
// this file is directly executed with `bun run`
|
||||
}else{
|
||||
} else {
|
||||
// this file is being imported by another file
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user