@rxap/node-utilities
Version:
Provides a set of utility functions for Node.js development, including file system operations, git integration, and package.json manipulation. It offers functionalities like copying folders, reading JSON files with retry logic, retrieving the current git
12 lines (11 loc) • 1.07 kB
TypeScript
/**
* Retrieves the peer dependencies of a specific package and version from the npm registry.
*
* This function fetches the package information using the `GetPackageInfo` function, then extracts and returns the peer dependencies for the specified version. If the specified version does not have any peer dependencies or the package information is not available, it returns an empty object.
*
* @param {string} packageName - The name of the package for which to retrieve peer dependencies.
* @param {string} [version='latest'] - The version of the package to query. Defaults to 'latest'.
* @param {boolean} [skipCache=false] - A boolean flag indicating whether to bypass the cache when fetching the package information.
* @returns {Promise<Record<string, string>>} A promise that resolves to an object containing the peer dependencies, where keys are package names and values are version ranges.
*/
export declare function GetPackagePeerDependencies(packageName: string, version?: string, skipCache?: boolean): Promise<import("./package-json").Dependency>;