We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
node:fs/promises
1 parent 4aa2057 commit aaa8362Copy full SHA for aaa8362
lib/fetch.js
@@ -3,11 +3,11 @@ if (typeof process === 'object' && process.release?.name === 'node') {
3
// Node doesn't have a usable `fetch()`.
4
fetch = async function(url, options) {
5
if (url.protocol === 'file:') {
6
- const { readFile } = await import('fs/promises');
+ const { readFile } = await import('node:fs/promises');
7
let contentType = 'application/octet-stream';
8
if (url.pathname.endsWith('.wasm'))
9
contentType = 'application/wasm';
10
- return new Response(await readFile(url), { headers: { "Content-Type": contentType } });
+ return new Response(await readFile(url), { headers: { 'Content-Type': contentType } });
11
} else {
12
return globalThis.fetch(url, options);
13
}
0 commit comments