No JSDoc comment in source yet.
API
@Component()
export class NpmPluginPackages implements PluginPackages {
constructor(private readonly io: PluginPackagesIo = machine);
check(root: string, spec: string): Promise<void>;
install(root: string, source: string): Promise<InstalledPackage>;
installFiles(root: string, files: Record<string, Uint8Array>): Promise<InstalledPackage>;
installTarball(root: string, file: string, name: string): Promise<InstalledPackage>;
installChannel(root: string, channel: IndexChannel, opts: { onProgress?: (received: number, total: number | null) => void } = {}): Promise<InstalledPackage>;
remove(root: string, name: string): Promise<void>;
}Dependencies & Wiring
Extracted from class decoratorsMethods (6)
check
check(root: string, spec: string): Promise<void>Whether the registry has a name, asked before it is installed: npm view within a short
window (install.ts checkPluginSource); without npm, the registry's document, each address
within the same window (direct-install.ts checkFromRegistry).
@paramroot
string@paramspec
string@returns
Promise<void>install
install(root: string, source: string): Promise<InstalledPackage>By name or by link (install.ts installPluginSource; without npm, by name only).
@paramroot
string@paramsource
string@returns
Promise<InstalledPackage>installFiles
installFiles(root: string, files: Record<string, Uint8Array>): Promise<InstalledPackage>An uploaded package's files (install.ts installPluginFiles).
@paramroot
string@paramfiles
Record<string, Uint8Array>@returns
Promise<InstalledPackage>installTarball
installTarball(root: string, file: string, name: string): Promise<InstalledPackage>A verified package tarball on this machine, an offline archive: npm installs it (install.ts installPluginTarball); without npm, it is placed directly (direct-install.ts installTarball).
@paramroot
string@paramfile
string@paramname
string@returns
Promise<InstalledPackage>installChannel
installChannel(root: string, channel: IndexChannel, opts: { onProgress?: (received: number, total: number | null) => void } = {}): Promise<InstalledPackage>A version from the published index's release channel (install.ts installPluginChannel).
@paramroot
string@paramchannel
IndexChannel@paramopts?
{ onProgress?: (received: number, total: number | null) => void }@returns
Promise<InstalledPackage>remove
remove(root: string, name: string): Promise<void>@paramroot
string@paramname
string@returns
Promise<void>