node/lib/internal
Joyee Cheung 472edc775d
src: disambiguate terms used to refer to builtins and addons
The term "native module" dates back to some of the oldest code
in the code base. Within the context of Node.js core it usually
refers to modules that are native to Node.js (e.g. fs, http),
but it can cause confusion for people who don't work on this
part of the code base, as "native module" can also refer to
native addons - which is even the case in some of the API
docs and error messages.

This patch tries to make the usage of these terms more consistent.
Now within the context of Node.js core:

- JavaScript scripts that are built-in to Node.js are now referred
  to as "built-in(s)". If they are available as modules,
  they can also be referred to as "built-in module(s)".
- Dynamically-linked shared objects that are loaded into
  the Node.js processes are referred to as "addons".

We will try to avoid using the term "native modules" because it could
be ambiguous.

Changes in this patch:

File names:
- node_native_module.h -> node_builtins.h,
- node_native_module.cc -> node_builtins.cc

C++ binding names:
- `native_module` -> `builtins`

`node::Environment`:
- `native_modules_without_cache` -> `builtins_without_cache`
- `native_modules_with_cache` -> `builtins_with_cache`
- `native_modules_in_snapshot` -> `builtins_in_cache`
- `native_module_require` -> `builtin_module_require`

`node::EnvSerializeInfo`:
- `native_modules` -> `builtins

`node::native_module::NativeModuleLoader`:
- `native_module` namespace -> `builtins` namespace
- `NativeModuleLoader` -> `BuiltinLoader`
- `NativeModuleRecordMap` -> `BuiltinSourceMap`
- `NativeModuleCacheMap` -> `BuiltinCodeCacheMap`
- `ModuleIds` -> `BuiltinIds`
- `ModuleCategories` -> `BuiltinCategories`
- `LoadBuiltinModuleSource` -> `LoadBuiltinSource`

`loader.js`:
- `NativeModule` -> `BuiltinModule` (the `NativeModule` name used in
  `process.moduleLoadList` is kept for compatibility)

And other clarifications in the documentation and comments.

PR-URL: https://github.com/nodejs/node/pull/44135
Fixes: https://github.com/nodejs/node/issues/44036
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2022-08-09 01:36:49 +08:00
..
assert assert: callTracker throw a specific error message when possible 2022-07-08 11:17:35 +01:00
bootstrap src: disambiguate terms used to refer to builtins and addons 2022-08-09 01:36:49 +08:00
child_process child_process: improve ipc write performance 2022-06-19 16:10:53 +02:00
cluster cluster: send connection to other server when worker drop it 2022-07-24 11:18:33 +01:00
console lib: refactor to avoid unsafe regex primordials 2022-06-27 17:16:06 +02:00
crypto crypto: remove unneeded guard 2022-07-18 05:49:16 +01:00
debugger src: disambiguate terms used to refer to builtins and addons 2022-08-09 01:36:49 +08:00
dns lib: add diagnostics channel and perf hooks detail 2022-07-29 14:27:16 +01:00
fs fs: use signed types for stat data 2022-07-18 16:35:14 +01:00
http2 lib: add Promise methods to avoid-prototype-pollution lint rule 2022-07-26 23:38:24 +01:00
legacy
main src: disambiguate terms used to refer to builtins and addons 2022-08-09 01:36:49 +08:00
modules src: disambiguate terms used to refer to builtins and addons 2022-08-09 01:36:49 +08:00
per_context lib: add Promise methods to avoid-prototype-pollution lint rule 2022-07-26 23:38:24 +01:00
perf src: per-environment time origin value 2022-07-16 16:46:40 +08:00
policy lib: refactor to avoid unsafe regex primordials 2022-06-27 17:16:06 +02:00
process src: disambiguate terms used to refer to builtins and addons 2022-08-09 01:36:49 +08:00
readline readline: fix to not access a property on an undefined value 2022-06-28 11:10:50 +01:00
repl repl: fix overzealous top-level await 2022-07-15 20:30:50 +01:00
source_map src,lib: print prinstine source when source map source not found 2022-08-06 19:56:27 +08:00
streams lib: add Promise methods to avoid-prototype-pollution lint rule 2022-07-26 23:38:24 +01:00
test
test_runner test_runner: refactor to use more primordials 2022-08-04 04:03:28 +00:00
tls crypto: don't disable TLS 1.3 without suites 2022-06-27 09:47:13 +01:00
util src: disambiguate terms used to refer to builtins and addons 2022-08-09 01:36:49 +08:00
v8 bootstrap: support more builtins in the embedded code cache 2022-08-05 01:11:20 +08:00
vm lib: implement safe alternatives to Promise static methods 2022-07-10 14:17:23 +01:00
webstreams stream: update TextEncoderStream to align the latest spec 2022-08-04 22:41:28 +00:00
worker lib: refactor transferable AbortSignal 2022-08-04 08:40:50 -07:00
abort_controller.js lib: refactor transferable AbortSignal 2022-08-04 08:40:50 -07:00
assert.js
async_hooks.js lib: use null-prototype objects for property descriptors 2022-06-03 09:23:58 +01:00
blob.js lib: refactor to avoid unsafe regex primordials 2022-06-27 17:16:06 +02:00
blocklist.js
buffer.js
child_process.js lib: use null-prototype objects for property descriptors 2022-06-03 09:23:58 +01:00
cli_table.js
constants.js
dgram.js
encoding.js lib: use kEmptyObject in various places 2022-06-11 12:18:16 +02:00
error_serdes.js lib: use null-prototype objects for property descriptors 2022-06-03 09:23:58 +01:00
errors.js errors: extract type detection & use in ERR_INVALID_RETURN_VALUE 2022-07-01 19:08:08 +01:00
event_target.js events: add CustomEvent 2022-07-17 12:27:49 +01:00
fixed_queue.js
freelist.js
freeze_intrinsics.js lib: fix TODO in freeze_intrinsics 2022-06-27 16:15:16 +01:00
heap_utils.js
histogram.js lib: use kEmptyObject in various places 2022-06-11 12:18:16 +02:00
http.js http: trace http request / response 2022-08-05 14:25:06 +00:00
idna.js
inspector_async_hook.js
js_stream_socket.js
linkedlist.js
net.js
options.js
priority_queue.js lib: refactor PriorityQueue to use private field 2022-07-23 21:44:18 +01:00
promise_hooks.js lib: use kEmptyObject in various places 2022-06-11 12:18:16 +02:00
querystring.js
readme.md
repl.js
socket_list.js
socketaddress.js
stream_base_commons.js
structured_clone.js
timers.js
trace_events_async_hooks.js
tty.js lib: refactor to avoid unsafe regex primordials 2022-06-27 17:16:06 +02:00
url.js lib: reset RegExp statics before running user code 2022-08-05 10:01:32 +02:00
util.js lib: reset RegExp statics before running user code 2022-08-05 10:01:32 +02:00
v8_prof_polyfill.js
v8_prof_processor.js
validators.js test_runner: validate timeout option 2022-07-24 23:11:16 +02:00
wasm_web_api.js bootstrap: support more builtins in the embedded code cache 2022-08-05 01:11:20 +08:00
watchdog.js
worker.js src: per-environment time origin value 2022-07-16 16:46:40 +08:00

Internal Modules

The modules in lib/internal are intended for internal use in Node.js core only, and are not accessible with require() from user modules. These modules can be changed at any time. Reliance on these modules outside of core is not supported in any way.