diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-23 23:51:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 23:51:07 +0100 |
commit | 60688c563e6d02813b021ad91132fe1eb3f103b6 (patch) | |
tree | 89e7862fa34a8e93cebed984ee5cfa44011d4230 /cli/js/40_testing.js | |
parent | 13d5c6420e3fe7f34e7c02a96922fe8db381503e (diff) |
feat: import.meta.filename and import.meta.dirname (#22061)
This commit adds `import.meta.filename` and `import.meta.dirname` APIs.
These APIs return string representation of filename and containing
dirname.
They are only defined for local modules (modules that have `file:///`
scheme).
Example:
```ts
console.log(import.meta.filename, import.meta.dirname)
```
Unix:
```
$ deno run /dev/my_module.ts
/dev/my_module.ts /dev/
```
Windows:
```
$ deno run C:\dev\my_module.ts
C:\dev\my_module.ts C:\
```
Diffstat (limited to 'cli/js/40_testing.js')
0 files changed, 0 insertions, 0 deletions