Lines Matching refs:url

43 const { fileURLToPath, URL } = require('internal/url');
124 * @param {string} url - The URL to convert.
126 function errPath(url) {
127 const parsed = new URL(url);
131 return url;
138 * @param {string} options.url - The URL of the module requesting the import.
142 async function importModuleDynamically(specifier, { url }, attributes) {
143 return asyncESM.esmLoader.import(specifier, url, attributes);
147 translators.set('module', async function moduleStrategy(url, source, isMain) {
150 maybeCacheSourceMap(url, source);
151 debug(`Translating StandardModule ${url}`);
152 const module = new ModuleWrap(url, undefined, source, 0, 0);
156 initializeImportMeta: (meta, wrap) => this.importMetaInitialize(meta, { url }),
183 translators.set('commonjs', async function commonjsStrategy(url, source,
185 debug(`Translating CJSModule ${url}`);
187 const filename = fileURLToPath(new URL(url));
194 return new ModuleWrap(url, undefined, namesWithDefault, function() {
195 debug(`Loading CJSModule ${url}`);
294 translators.set('builtin', async function builtinStrategy(url) {
295 debug(`Translating BuiltinModule ${url}`);
297 const id = StringPrototypeSlice(url, 5);
298 const module = loadBuiltinModule(id, url);
299 if (!StringPrototypeStartsWith(url, 'node:') || !module) {
300 throw new ERR_UNKNOWN_BUILTIN_MODULE(url);
302 debug(`Loading BuiltinModule ${url}`);
307 translators.set('json', async function jsonStrategy(url, source) {
310 debug(`Loading JSONModule ${url}`);
311 const pathname = StringPrototypeStartsWith(url, 'file:') ?
312 fileURLToPath(url) : null;
315 pathname && !StringPrototypeIncludes(url, '?') && !StringPrototypeIncludes(url, '#');
324 return new ModuleWrap(url, undefined, ['default'], function() {
337 return new ModuleWrap(url, undefined, ['default'], function() {
353 err.message = errPath(url) + ': ' + err.message;
359 return new ModuleWrap(url, undefined, ['default'], function() {
360 debug(`Parsing JSONModule ${url}`);
366 translators.set('wasm', async function(url, source) {
371 debug(`Translating WASMModule ${url}`);
377 err.message = errPath(url) + ': ' + err.message;
390 return createDynamicModule(imports, exports, url, (reflect) => {