@@ -283,9 +283,9 @@ were registered. The same applies to all the other hooks.
283283### Communication between main and hooks threads
284284
285285Module customization hooks run on a dedicated thread, separate from the main
286- thread that runs application code. This means that global variables are unique
287- to each thread, and message channels must be used to communicate between the
288- threads.
286+ thread that runs application code. This means mutating global variables won't
287+ affect the other thread(s) , and message channels must be used to communicate
288+ between the threads.
289289
290290The ` register` method can be used to pass data to an [` initialize` ][] hook on
291291the hooks thread. The data passed to the hook may include transferrable objects
@@ -388,7 +388,7 @@ This hook can send and receive data from a [`register`][] invocation, including
388388ports and other transferrable objects. The return value of ` initialize` must be
389389either:
390390
391- * ` undefined` or ` void ` ,
391+ * ` undefined` ,
392392* something that can be posted as a message between threads (e.g. the input to
393393 [` port.postMessage` ][]),
394394* a ` Promise` resolving to one of the aforementioned values.
@@ -420,7 +420,7 @@ port1.on('message', (msg) => {
420420 assert .strictEqual (msg, ' increment: 2' );
421421});
422422
423- const result = register (' /path-to-my-hooks.js' , {
423+ const result = register (' . /path-to-my-hooks.js' , {
424424 parentURL: import .meta.url,
425425 data: { number: 1 , port: port2 },
426426 transferList: [port2],
@@ -444,7 +444,7 @@ port1.on('message', (msg) => {
444444 assert .strictEqual (msg, ' increment: 2' );
445445});
446446
447- const result = register (' /path-to-my-hooks.js' , {
447+ const result = register (' . /path-to-my-hooks.js' , {
448448 parentURL: pathToFileURL (__filename ),
449449 data: { number: 1 , port: port2 },
450450 transferList: [port2],
@@ -608,10 +608,11 @@ loader with registered `resolve` and `load` hooks; all `require.resolve` calls
608608from this module will be processed by the ESM loader with registered ` resolve`
609609hooks; ` require .extensions ` and monkey-patching on the CommonJS module loader
610610will not apply. (In other words, handled ` require` calls will behave similarly
611- to an ` import ` of a CommonJS module.) If ` source` is undefined or ` null` , it
612- will be handled by the CommonJS module loader and ` require` /` require.resolve`
613- calls will not go through the registered hooks. This behavior for nullish
614- ` source` is temporary — in the future, nullish ` source` will not be supported.
611+ to an ` import ` of a CommonJS module, other than ` require` being sync.) If
612+ ` source` is undefined or ` null` , it will be handled by the CommonJS module
613+ loader and ` require` /` require.resolve` calls will not go through the registered
614+ hooks. This behavior for nullish ` source` is temporary — in the future, nullish
615+ ` source` will not be supported.
615616
616617The Node.js internal ` load` implementation, which is the value of ` next` for the
617618last hook in the ` load` chain, returns ` null` for ` source` when ` format` is
0 commit comments