module: implement register utility

PR-URL: https://github.com/nodejs/node/pull/46826
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
João Lenon 2023-06-11 21:00:46 -03:00 committed by GitHub
parent d2d4a310f1
commit a40a6c890a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 490 additions and 10 deletions

View file

@ -146,9 +146,9 @@ async function initializeHooks() {
load(url, context) { return hooks.load(url, context); }
}
const privateModuleLoader = new ModuleLoader();
const parentURL = pathToFileURL(cwd).href;
// TODO(jlenon7): reuse the `Hooks.register()` method for registering loaders.
for (let i = 0; i < customLoaderURLs.length; i++) {
const customLoaderURL = customLoaderURLs[i];