@@ -57,7 +57,7 @@ or when referenced by `import` statements within ES module code:
5757* Strings passed in as an argument to ` --eval ` or ` --print ` , or piped to
5858 ` node ` via ` STDIN ` , with the flag ` --input-type=commonjs ` .
5959
60- ### < code > package.json</ code > < code > "type"</ code > field
60+ ### ` package.json ` ` "type" ` field
6161
6262Files ending with ` .js ` or ` .mjs ` , or lacking any extension,
6363will be loaded as ES modules when the nearest parent ` package.json ` file
@@ -159,7 +159,7 @@ package scope:
159159 extension (since both ` .js ` and ` .cjs ` files are treated as CommonJS within a
160160 ` "commonjs" ` package scope).
161161
162- ### < code > --input-type</ code > flag
162+ ### ` --input-type ` flag
163163
164164Strings passed in as an argument to ` --eval ` or ` --print ` (or ` -e ` or ` -p ` ), or
165165piped to ` node ` via ` STDIN ` , will be treated as ES modules when the
@@ -190,7 +190,7 @@ defined in `"exports"`. If package entry points are defined in both `"main"` and
190190` "exports" ` . [ Conditional Exports] [ ] can also be used within ` "exports" ` to
191191define different package entry points per environment.
192192
193- #### < code > package.json</ code > < code > "main"</ code >
193+ #### ` package.json ` ` "main" `
194194
195195The ` package.json ` ` "main" ` field defines the entry point for a package,
196196whether the package is included into CommonJS via ` require ` or into an ES
@@ -710,7 +710,7 @@ If the `--experimental-conditional-exports` flag is dropped and therefore
710710easily updated to use conditional exports by adding conditions to the ` "."`
711711path; while keeping ` "./module"` for backward compatibility.
712712
713- ## < code > import </code> Specifiers
713+ ## ` import` Specifiers
714714
715715### Terminology
716716
@@ -767,7 +767,7 @@ import 'data:text/javascript,console.log("hello!");';
767767import _ from 'data:application/json,"world!"';
768768` ` `
769769
770- ## import .meta
770+ ## ` import.meta`
771771
772772* {Object }
773773
@@ -786,12 +786,12 @@ indexes (e.g. `'./startup/index.js'`) must also be fully specified.
786786This behavior matches how ` import` behaves in browser environments, assuming a
787787typically configured server.
788788
789- ### No < code > NODE_PATH < / code >
789+ ### No ` NODE_PATH`
790790
791791` NODE_PATH` is not part of resolving ` import` specifiers . Please use symlinks
792792if this behavior is desired.
793793
794- ### No < code > require< / code > , < code > exports < / code > , < code > module .exports < / code > , < code > \_\_filename < / code > , < code > \_\_dirname < / code >
794+ ### No ` require` , ` exports` , ` module.exports` , ` __filename ` , ` __dirname `
795795
796796These CommonJS variables are not available in ES modules.
797797
@@ -808,12 +808,12 @@ const __filename = fileURLToPath(import.meta.url);
808808const __dirname = dirname(__filename);
809809` ` `
810810
811- ### No < code > require .extensions < / code >
811+ ### No ` require.extensions`
812812
813813` require.extensions` is not used by ` import` . The expectation is that loader
814814hooks can provide this workflow in the future.
815815
816- ### No < code > require .cache < / code >
816+ ### No ` require.cache`
817817
818818` require.cache` is not used by ` import` . It has a separate cache.
819819
@@ -835,15 +835,15 @@ For now, only modules using the `file:` protocol can be loaded.
835835
836836## Interoperability with CommonJS
837837
838- ### < code > require< / code >
838+ ### ` require`
839839
840840` require` always treats the files it references as CommonJS . This applies
841841whether ` require` is used the traditional way within a CommonJS environment, or
842842in an ES module environment using [` module.createRequire()` ][].
843843
844844To include an ES module into CommonJS, use [` import()` ][].
845845
846- ### < code > import </code> statements
846+ ### ` import` statements
847847
848848An ` import` statement can reference an ES module or a CommonJS module . Other
849849file types such as JSON or Native modules are not supported . For those, use
@@ -874,7 +874,7 @@ import packageMain from 'commonjs-package'; // Works
874874import { method } from 'commonjs-package'; // Errors
875875` ` `
876876
877- ### < code > import ()< / code > expressions
877+ ### ` import()` expressions
878878
879879Dynamic ` import()` is supported in both CommonJS and ES modules . It can be used
880880to include ES module files from CommonJS code.
0 commit comments