Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: ESM documentation consolidation and reordering #36046

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
guybedford and aduh95 authored Nov 9, 2020
commit b44219c0042d02c5a967e1e47b6578dc3469a5ae
6 changes: 3 additions & 3 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The _specifier_ of an `import` statement is the string after the `from` keyword,
e.g. `'path'` in `import { sep } from 'path'`. Specifiers are also used in
`export from` statements, and as the argument to an `import()` expression.

There are four types of specifiers:
There are three types of specifiers:

* _Relative specifiers_ like `'./startup.js'` or `'../config.mjs'`. They refer
to a path relative to the location of the importing file. _The file extension
Expand All @@ -130,7 +130,7 @@ There are four types of specifiers:

Bare specifier resolutions are handled by the [Node.js module resolution
algorithm][]. All other specifier resolutions are always only resolved with
the standard relative [URL](https://url.spec.whatwg.org/) resolution semantics.
the standard relative [URL][] resolution semantics.

Like in CommonJS, module files within packages can be accessed by appending a
path to the package name; unless the package’s [`package.json`][] contains an
guybedford marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -169,7 +169,7 @@ import './foo.mjs?query=2'; // loads ./foo.mjs with query of "?query=2"
```

The volume root may be referenced via `/`, `//` or `file:///`. Given the
differences between URL and path resolution (such as percent encoding details),
differences between [URL][] and path resolution (such as percent encoding details),
it is recommended to use [url.pathToFileURL][] when importing a path.

#### `data:` Imports
Expand Down