type alias LocalTarget

What sits at the far end of a resolved specifier.

  • "elsewhere" — not on this machine (jsr:, npm:, https:), so there is nothing to stat and the runtime resolves it.
  • "module" — a file, which is what a package argument has to name.
  • "directory" — refused, with LocalTarget.modules offered as the candidates to name instead.
  • "missing" — nothing is there at all, which is a different mistake from naming a directory and gets a different message.
  • "unreadable" — the target could not be inspected: read permission was denied, or the file: specifier does not parse as a URL and so names no path to inspect at all. Refused rather than assumed to be a module: assuming is how the directory case produced confident wrong output.

Definition

{ readonly kind: "elsewhere"; }
| { readonly kind: "module"; }
| { readonly kind: "directory"; readonly modules: readonly string[]; }
| { readonly kind: "missing"; }
| { readonly kind: "unreadable"; readonly reason: string; }

Usage

import { type LocalTarget } from "mod.ts";