diff options
Diffstat (limited to 'docs/guides/util/import-meta-path.md')
-rw-r--r-- | docs/guides/util/import-meta-path.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/guides/util/import-meta-path.md b/docs/guides/util/import-meta-path.md new file mode 100644 index 000000000..b93670a38 --- /dev/null +++ b/docs/guides/util/import-meta-path.md @@ -0,0 +1,13 @@ +--- +name: Get the absolute path of the current file +--- + +Bun provides a handful of module-specific utilities on the [`import.meta`](/docs/api/import-meta) object. Use `import.meta.path` to retreive the absolute path of the current file. + +```ts#/a/b/c.ts +import.meta.path; // => "/a/b/c.ts" +``` + +--- + +See [Docs > API > import.meta](/docs/api/import-meta) for complete documentation. |