File tree Expand file tree Collapse file tree 7 files changed +14
-24
lines changed Expand file tree Collapse file tree 7 files changed +14
-24
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ calling `require('node:crypto')` will result in an error being thrown.
4242
4343When using CommonJS, the error thrown can be caught using try/catch:
4444
45- <!-- eslint-skip -->
45+ <!-- eslint-disable no-global-assign -->
4646
4747``` cjs
4848let crypto;
5353}
5454```
5555
56+ <!-- eslint-enable no-global-assign -->
57+
5658When using the lexical ESM ` import ` keyword, the error can only be
5759caught if a handler for ` process.on('uncaughtException') ` is registered
5860_ before_ any attempt to load the module is made (using, for instance,
Original file line number Diff line number Diff line change @@ -2938,9 +2938,7 @@ signal (such as [`subprocess.kill()`][]).
29382938[ self-reference a package using its name] [ ] and [ define a custom subpath] [ ] in
29392939the [ ` "exports" ` ] [ ] field of the [ ` package.json ` ] [ ] file.
29402940
2941- <!-- eslint-skip -->
2942-
2943- ``` js
2941+ ``` mjs
29442942import ' ./' ; // unsupported
29452943import ' ./index.js' ; // supported
29462944import ' package-name' ; // supported
Original file line number Diff line number Diff line change @@ -16,14 +16,12 @@ user is able to stream data.
1616
1717HTTP message headers are represented by an object like this:
1818
19- <!-- eslint-skip -->
20-
21- ``` js
22- { ' content-length' : ' 123' ,
23- ' content-type' : ' text/plain' ,
24- ' connection' : ' keep-alive' ,
25- ' host' : ' example.com' ,
26- ' accept' : ' */*' }
19+ ``` json
20+ { "content-length" : " 123" ,
21+ "content-type" : " text/plain" ,
22+ "connection" : " keep-alive" ,
23+ "host" : " example.com" ,
24+ "accept" : " */*" }
2725```
2826
2927Keys are lowercased. Values are not modified.
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ calling `require('node:https')` will result in an error being thrown.
1717
1818When using CommonJS, the error thrown can be caught using try/catch:
1919
20- <!-- eslint-skip -->
21-
2220``` cjs
2321let https;
2422try {
Original file line number Diff line number Diff line change @@ -87,12 +87,10 @@ collection of key and value pairs.
8787
8888For example, the query string ` 'foo=bar&abc=xyz&abc=123' ` is parsed into:
8989
90- <!-- eslint-skip -->
91-
92- ``` js
90+ ``` json
9391{
94- foo: ' bar' ,
95- abc: [' xyz' , ' 123' ]
92+ " foo" : " bar" ,
93+ " abc" : [" xyz" , " 123" ]
9694}
9795```
9896
Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ calling `require('node:tls')` will result in an error being thrown.
2222
2323When using CommonJS, the error thrown can be caught using try/catch:
2424
25- <!-- eslint-skip -->
26-
2725``` cjs
2826let tls;
2927try {
Original file line number Diff line number Diff line change @@ -2513,9 +2513,7 @@ added: v10.0.0
25132513
25142514Returns ` true ` if the value is an instance of a [Module Namespace Object][].
25152515
2516- <!-- eslint-skip -->
2517-
2518- ` ` ` js
2516+ ` ` ` mjs
25192517import * as ns from ' ./a.js' ;
25202518
25212519util .types .isModuleNamespaceObject (ns); // Returns true
You can’t perform that action at this time.
0 commit comments