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