1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-14 19:37:59 -05:00
denoland-deno/cli/tests/testdata/run/import_meta
Bartek Iwańczuk 60688c563e
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:\
```
2024-01-23 23:51:07 +01:00
..
importmap.json fix: allow npm: specifiers in import.meta.resolve (#21716) 2023-12-28 20:37:10 +01:00
main.out feat: import.meta.filename and import.meta.dirname (#22061) 2024-01-23 23:51:07 +01:00
main.ts feat: import.meta.filename and import.meta.dirname (#22061) 2024-01-23 23:51:07 +01:00
other.ts feat: import.meta.filename and import.meta.dirname (#22061) 2024-01-23 23:51:07 +01:00