Skip to main content
Module

x/deno2node/src/shim.node.ts

Compile your Deno project to run on Node.js.
Go to Latest
File
// Node-only, see https://github.com/fromdeno/deno2node#shimmingimport { readFile } from "fs/promises";
export * from "@deno/shim-deno";
export async function fetch(fileUrl: URL) { if (fileUrl.protocol !== "file:") { throw new Error("Can only read local files!"); } const data = await readFile(fileUrl, { encoding: "utf-8" }); return { json: () => JSON.parse(data), text: () => data, };}