UNPKG

edge-location

Version:

Approximates the current location of the Edge browser across platforms.

28 lines (27 loc) 978 B
import fs from 'node:fs'; export type FsLike = Pick<typeof fs, 'existsSync' | 'readdirSync'>; export type WhichLike = { sync: (cmd: string) => string; }; export type Deps = { fs?: FsLike; which?: WhichLike; env?: NodeJS.ProcessEnv; platform?: NodeJS.Platform; userhome?: (p: string) => string; }; export default function locateEdge(allowFallbackOrDeps?: boolean | Deps, depsMaybe?: Deps): string | null; export declare function getInstallGuidance(): string; export declare function locateEdgeOrExplain(options?: boolean | { allowFallback?: boolean; }): string; /** * Cross-platform Edge version resolver. * - Never executes the browser by default. * - On Windows: reads PE metadata via PowerShell. * - On macOS: reads Info.plist next to the binary. * - On Linux/others: returns null unless opts.allowExec is true, then tries --version. */ export declare function getEdgeVersion(bin: string, opts?: { allowExec?: boolean; }): string | null;