mirror of
https://github.com/denoland/deno.git
synced 2024-12-11 10:07:54 -05:00
60688c563e
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:\ ```
13 lines
747 B
Text
13 lines
747 B
Text
other remote [WILDCARD]other.ts false undefined undefined
|
|
other [WILDCARD]other.ts false [WILDCARD]other.ts [WILDCARD]
|
|
main [WILDCARD]main.ts true [WILDCARD]main.ts [WILDCARD]
|
|
Resolving ./foo.js file:///[WILDCARD]/foo.js
|
|
Resolving bare from import map https://example.com/
|
|
Resolving https://example.com/rewrite from import map https://example.com/rewritten
|
|
Resolving without a value from import map https://example.com/PASS-undefined
|
|
Resolving 1 from import map https://example.com/PASS-1
|
|
Resolving null from import map https://example.com/PASS-null
|
|
Resolving object from import map https://example.com/PASS-object
|
|
Resolving npm:cowsay npm:cowsay
|
|
Resolving npm:cowsay@1 npm:cowsay@1
|
|
Resolving npm:preact from import map https://example.com/preact
|