//#region src/lib/resolve-package.d.ts /** * Locate an installed package by walking `node_modules` up from `fromDir`, the way Node * resolves. * * Deliberately not `require.resolve`. These packages routinely ship an `exports` map that * lists only `.`, which makes both `require.resolve(pkg)` and `require.resolve(pkg + * "/package.json")` throw `ERR_PACKAGE_PATH_NOT_EXPORTED` even though the package is right * there on disk. `sharp` is one of them, so a resolver-based lookup fails on exactly the * package this whole feature exists for. * * `throwIfNoEntry: false` rather than a `try`/`catch`: a missing directory is the expected * signal to keep walking, but a permission or loop error is a real fault and must propagate * instead of being read as "not here" — that silently returns an ancestor's copy of the * package, which is a different version than the one being deployed. */ declare function findPackageDir(fromDir: string, name: string): string | undefined; /** A package's parsed manifest, or `undefined` when it is absent or unparseable. */ declare function readPackageManifest(dir: string): Record | undefined; /** * The version of `name` as installed under `fromDir`, or `undefined` when it is not * installed. Callers treat `undefined` as "cannot pin" and must say so rather than quietly * installing whatever the registry calls latest. */ declare function installedPackageVersion(fromDir: string, name: string): string | undefined; //#endregion export { findPackageDir, installedPackageVersion, readPackageManifest }; //# sourceMappingURL=resolve-package.d.ts.map