@@ -380,7 +380,7 @@ them as different modules and will reload the file multiple times. For example,
380380` require('./foo') ` and ` require('./FOO') ` return two different objects,
381381irrespective of whether or not ` ./foo ` and ` ./FOO ` are the same file.
382382
383- ## Core modules
383+ ## Built-in modules
384384
385385<!-- type=misc-->
386386
@@ -396,20 +396,31 @@ changes:
396396Node.js has several modules compiled into the binary. These modules are
397397described in greater detail elsewhere in this documentation.
398398
399- The core modules are defined within the Node.js source and are located in the
399+ The built-in modules are defined within the Node.js source and are located in the
400400` lib/ ` folder.
401401
402- Core modules can be identified using the ` node: ` prefix, in which case
402+ built-in modules can be identified using the ` node: ` prefix, in which case
403403it bypasses the ` require ` cache. For instance, ` require('node:http') ` will
404404always return the built in HTTP module, even if there is ` require.cache ` entry
405405by that name.
406406
407- Some core modules are always preferentially loaded if their identifier is
407+ Some built-in modules are always preferentially loaded if their identifier is
408408passed to ` require() ` . For instance, ` require('http') ` will always
409409return the built-in HTTP module, even if there is a file by that name. The list
410- of core modules that can be loaded without using the ` node: ` prefix is exposed
410+ of built-in modules that can be loaded without using the ` node: ` prefix is exposed
411411as [ ` module.builtinModules ` ] [ ] .
412412
413+ ### Built-in modules with mandatory ` node: ` prefix
414+
415+ When being loaded by ` require() ` , some built-in modules must be requested with the
416+ ` node: ` prefix. This requirement exists to prevent newly introduced built-in
417+ modules from having a conflict with user land packages that already have
418+ taken the name. Currently the built-in modules that requires the ` node: ` prefix are:
419+
420+ * [ ` node:sea ` ] [ ]
421+ * [ ` node:test ` ] [ ]
422+ * [ ` node:test/reporters ` ] [ ]
423+
413424## Cycles
414425
415426<!-- type=misc-->
@@ -552,7 +563,7 @@ folders as modules, and work for both `require` and `import`.
552563<!-- type=misc-->
553564
554565If the module identifier passed to ` require() ` is not a
555- [ core ] ( #core -modules ) module, and does not begin with ` '/' ` , ` '../' ` , or
566+ [ built-in ] ( #built-in -modules ) module, and does not begin with ` '/' ` , ` '../' ` , or
556567` './' ` , then Node.js starts at the directory of the current module, and
557568adds ` /node_modules ` , and attempts to load the module from that location.
558569Node.js will not append ` node_modules ` to a path already ending in
@@ -1166,6 +1177,9 @@ This section was moved to
11661177[ `module.id` ] : #moduleid
11671178[ `module` core module ] : module.md
11681179[ `module` object ] : #the-module-object
1180+ [ `node:sea` ] : single-executable-applications.md#single-executable-application-api
1181+ [ `node:test/reporters` ] : test.md#test-reporters
1182+ [ `node:test` ] : test.md
11691183[ `package.json` ] : packages.md#nodejs-packagejson-field-definitions
11701184[ `path.dirname()` ] : path.md#pathdirnamepath
11711185[ `require.main` ] : #requiremain
0 commit comments