UNPKG

jsii-docgen

Version:

generates api docs for jsii modules

59 lines (58 loc) 2.29 kB
export declare class Npm { #private; private readonly workingDirectory; private readonly logger; constructor(workingDirectory: string, logger?: (message?: any, ...optionalParams: any[]) => void, npmCommand?: string); /** * Installs the designated package into this repository's working directory. * * @param target the name or path to the package that needs to be installed. * @param force whether to pass `--force` to `npm install`. * * @returns the name of the package that was installed. */ install(target: string, force?: boolean): Promise<string>; private listOptionalPeerDeps; /** * Obtains the path to the npm command that should be run. This always returns * the path to an npm >= 7, which "correctly" handles peerDependencies. If the * npm version that's available in $PATH satisfies this predicate, this will * simply return `npm`. */ private npmCommandPath; /** * Runs the supplied command with the provided arguments, captures the data * pushed to STDOUT, and "parses" it using `outputTransform` to produce a * result. * * You must consult the `exitCode` of the return value to determine whether * the command was successful or not. Use the `assertSuccess` function to * throw/reject in case the execution was not successful. * * @param command the command to invoke. * @param args arguments to provide to the command. * @param outputTransform the function that will parse STDOUT data. * @param options additional `spawn` options, if necessary. */ private runCommand; } /** * A filter to apply when selecting optional peer dependencies, based on how * their version target is specified. */ export declare enum OptionalPeerDepsFilter { /** * Ignore all optional peer dependencies when installing. */ None = 0, /** * Install only optional peer dependencies specified as a version range, and * ignore those specified as a URL or local path. */ VersionRange = 1, /** * Install all optional peer dependencies regardless of how they are * specified. This requires URL and local-path dependencies to be reachable. */ All = 2 }