deno.land / x / deno2node@v1.6.0 / src / shim.node.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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, };}
deno2node

Version Info

Tagged at
a year ago