@@ -216,7 +216,7 @@ resolution and loading behavior. See [Customization hooks][].
216
216
217
217
This feature requires ` --allow-worker` if used with the [Permission Model][].
218
218
219
- ### ` module.resolveLoadAndCache (specifier[ , parentURL[, importAttributes[, conditions] ]])`
219
+ ### ` module.resolve (specifier, parentURL[, importAttributes]])`
220
220
221
221
<!-- YAML
222
222
added: REPLACEME
@@ -227,21 +227,59 @@ added: REPLACEME
227
227
* ` specifier` {string|URL} Module to resolve and load; this should be
228
228
the same string that would be passed to ` import()` , except that if it is
229
229
relative, it is resolved relative to ` parentURL` .
230
- * ` parentURL` {string|URL|undefined} If you want to resolve ` specifier` relative to a base
231
- URL, such as ` import.meta.url` , you can pass that URL here. If not provided,
232
- the ` resolve` step will be skipped. **Default:** {undefined}.
233
- * ` importAttributes` {Object}
230
+ * ` parentURL ` {string|URL|undefined} The base URL to resolve ` specifier ` from,
231
+ such as ` import.meta.url` .
232
+ * ` importAttributes` {Object} **Default:** an empty object.
233
+ * Returns: {Promise} fulfills with a string containing the full URL of the
234
+ potential module corresponding to the given specifier.
235
+
236
+ Analogous to ` import .meta .resolve ` , but asynchronous, accessible from CommonJS
237
+ modules, and with additional parameters.
238
+
239
+ ### ` module.load(url[, importAttributes[, conditions]]])`
240
+
241
+ <!-- YAML
242
+ added: REPLACEME
243
+ -->
244
+
245
+ > Stability: 1 - Experimental
246
+
247
+ * ` url` {string|URL|undefined} The URL of the module to load.
248
+ * ` importAttributes` {Object} **Default:** an empty object.
249
+ * ` conditions` {Array}
250
+ * Returns: {Promise} fulfills with an object with the following properties:
251
+ * ` url` {string} The absolute URL for that module
252
+ * ` format` {string} The format this module will be parsed as.
253
+ * ` source` {null|TypedArray}
254
+
255
+ This API tells you how the passed URL would be loaded by the module loader if
256
+ it was imported in the current process – or, if ` conditions` is provided, how
257
+ would it be loaded in a process with such configuration.
258
+
259
+ ### ` module.resolveLoadAndCache(specifier, parentURL[, importAttributes[, conditions]]])`
260
+
261
+ <!-- YAML
262
+ added: REPLACEME
263
+ -->
264
+
265
+ > Stability: 1 - Experimental
266
+
267
+ * ` specifier` {string|URL} Module to resolve and load; this should be
268
+ the same string that would be passed to ` import()` , except that if it is
269
+ relative, it is resolved relative to ` parentURL` .
270
+ * ` parentURL ` {string|URL|undefined} The base URL to resolve ` specifier ` from,
271
+ such as ` import.meta.url` .
272
+ * ` importAttributes` {Object} **Default:** an empty object.
234
273
* ` conditions` {Array}
235
274
* Returns: {Promise} fulfills with an object with the following properties:
236
275
* ` url` {string} The absolute URL for that module
237
276
* ` format` {string} The format this module will be parsed as.
238
277
* ` source` {null|TypedArray}
239
278
240
- This API tells you how a specific URL will be loaded by the module loader if
241
- it was imported from the ` parentURL` in the current process. If the module was
242
- already imported before ` resolveLoadAndCache` is called, the cached version is
243
- returned; if not, it will populate the cache so future calls to
244
- ` resolveLoadAndCache` or ` import` do not re-do the work.
279
+ This API tells you how the passed specifier would be loaded by the module loader if
280
+ it was imported from the ` parentURL` in the current process – or, if
281
+ ` conditions` is provided, how would it be loaded in a process with such
282
+ configuration.
245
283
246
284
### ` module.registerHooks(options)`
247
285
0 commit comments