UNPKG

chrome-location2

Version:

Approximates the current location of the Chrome browser across platforms.

27 lines (26 loc) 970 B
import fs from 'node:fs'; export type FsLike = Pick<typeof fs, 'existsSync' | 'readdirSync' | 'statSync'>; 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 locateChrome(allowFallbackOrDeps?: boolean | Deps, depsMaybe?: Deps): string | null; export declare function getInstallGuidance(): string; export declare function locateChromeOrExplain(options?: boolean | { allowFallback?: boolean; }): string; /** * Cross-platform Chrome version resolver. * - Never executes the browser by default. * - Tries to read version from Puppeteer cache paths or platform metadata. * - If opts.allowExec is true, may invoke the binary as a last resort (Linux/other). */ export declare function getChromeVersion(bin: string, opts?: { allowExec?: boolean; }): string | null;