Skip to content

Commit

Permalink
Document additions to import.meta
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Jan 16, 2024
1 parent f47def8 commit a4da0ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/api/import-meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import.meta.resolveSync("zod")

---

- `import.meta.dirname`
- An alias to `import.meta.dir`, for Node.js compatibility

---

- `import.meta.file`
- The name of the current file, e.g. `index.tsx`

Expand All @@ -33,6 +38,16 @@ import.meta.resolveSync("zod")

---

- `import.meta.filename`
- An alias to `import.meta.path`, for Node.js compatibility

---

- `import.meta.url`
- A string url to the current file, e.g. `file:///path/to/project/index.tx`

---

- `import.meta.main`
- `boolean` Indicates whether the current file is the entrypoint to the current `bun` process. Is the file being directly executed by `bun run` or is it being imported?

Expand Down

0 comments on commit a4da0ac

Please sign in to comment.