Skip to content

Commit aaa8362

Browse files
committed
Qualify import as node:fs/promises.
1 parent 4aa2057 commit aaa8362

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fetch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ if (typeof process === 'object' && process.release?.name === 'node') {
33
// Node doesn't have a usable `fetch()`.
44
fetch = async function(url, options) {
55
if (url.protocol === 'file:') {
6-
const { readFile } = await import('fs/promises');
6+
const { readFile } = await import('node:fs/promises');
77
let contentType = 'application/octet-stream';
88
if (url.pathname.endsWith('.wasm'))
99
contentType = 'application/wasm';
10-
return new Response(await readFile(url), { headers: { "Content-Type": contentType } });
10+
return new Response(await readFile(url), { headers: { 'Content-Type': contentType } });
1111
} else {
1212
return globalThis.fetch(url, options);
1313
}

0 commit comments

Comments
 (0)