firefox-location2
Version:
Approximates the current location of the Firefox browser across platforms.
34 lines (33 loc) • 1.04 kB
TypeScript
export type FsLike = {
existsSync: (p: string) => boolean;
};
export type WhichLike = {
sync: (cmd: string) => string;
};
export type Deps = {
fs?: FsLike;
which?: WhichLike;
os?: {
homedir: () => string;
};
path?: {
join: (...parts: string[]) => string;
};
env?: NodeJS.ProcessEnv;
platform?: NodeJS.Platform;
};
export default function locateFirefox(allowFallbackOrDeps?: boolean | Deps, depsMaybe?: Deps): string | null;
export declare function getInstallGuidance(): string;
export declare function locateFirefoxOrExplain(options?: boolean | {
allowFallback?: boolean;
}): string;
/**
* Cross-platform Firefox 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 getFirefoxVersion(bin: string, opts?: {
allowExec?: boolean;
}): string | null;