render-package
v1.0.12
Published
> TODO: description
Downloads
3
Readme
render-package
render中封装的下载npm包的类
Usage
import Package = require('render-package');
// pkgName npm包名
// storePath 本地存储路径
const package = new Package({pkgName,storePath})
// 类型定义如下
interface Options {
version?: string;
pkgName: string;
storePath?: string;
pkgPath?: string;
}
declare class Package {
version?: string;
pkgName: string;
storePath?: string;
pkgPath?: string;
constructor(options?: Options);
prepare(): Promise<void>;
getNpmPkgLatestVersion(): Promise<string>;
install(version?: string): Promise<any>;
canIInstall(): Promise<boolean>;
isLocalPkgExist(version: string): Promise<boolean>;
update(): Promise<void>;
deleteOldVersionPkg(): Promise<void>;
localPkgPath(version: string): string;
getPkgCachePath(): Promise<string>;
}
export = Package;