Skip to content

Commit

Permalink
Remove statement about Node.js returning a promise for `import.meta.r…
Browse files Browse the repository at this point in the history
…esolve()` (mdn#30264)

* Remove statement about Node.js returning a promise for `import.meta.resolve()`

Since Node.js version 20.x (now LTS), Node.js returns a `string` instead of a `Promise<string>` for `import.meta.resolve()`.

This commit also adds a link to the Node.js documentation referencing the experimental flag.

* Change `import.meta.resolve()` statement for Node.js to being available without a flag
  • Loading branch information
LuudJanssen committed Nov 14, 2023
1 parent bdeedf0 commit 35bb8ce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Some tools recognize `new URL("./lib/helper.js", import.meta.url).href` as a dep
This means that `import.meta.resolve()` is not required to be implemented by all conformant JavaScript implementations. However, `import.meta.resolve()` may also be available in non-browser environments:
- Deno implements [compatibility with browser behavior](https://deno.land/manual/runtime/import_meta_api).
- Node.js has an implementation that is available using the `--experimental-import-meta-resolve` and currently returns a `Promise` instead of a string, although this may change to match browsers.
- Node.js also implements [the `import.meta.resolve()` function](https://nodejs.org/docs/latest/api/esm.html#importmetaresolvespecifier), but adds an additional `parent` parameter if you use the `--experimental-import-meta-resolve` flag.
## Examples
Expand Down

0 comments on commit 35bb8ce

Please sign in to comment.