@oazmi/build-tools - v0.2.7
    Preparing search index...

    Function getDenoJson

    • this function loads your "deno.json" file at the provided path, as a fully statically typed javascript object.
      to get the typings of your actual "deno.json" file, you will need to do some gymnastics, like in the example at the bottom.

      Type Parameters

      • DENO_JSON extends MaybePromise<DenoJson>

      Parameters

      • deno_json_path: string | URL = default_deno_json_path

        the path to your "deno.json" file. it could be either an absolute path, or a path relative to your current working directory (Deno.cwd()).

      Returns Promise<DENO_JSON>

      a fully typed "deno.json" like javascript object.

      import { getDenoJson } from "jsr:@oazmi/build-tools/funcdefs"
      // Deno LSP annotates json imports done via dynamic static-path imports: `import("./path/to/your/deno.json", {with: "json"})`
      const get_my_deno_json = async () => {
      return (await import("./deno.json", { with: { type: "json" } })).default
      }
      // `get_my_deno_json` is never actually called. it is only used for annotation of the returned `my_deno_json` javascript object, rather than it having a generalized `DenoJson` type.
      const my_deno_json = await getDenoJson<ReturnType<typeof get_my_deno_json>>("./cwd_path/to/deno.json")