render-package
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

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;

/render-package/

    Package Sidebar

    Install

    npm i render-package

    Weekly Downloads

    0

    Version

    1.0.12

    License

    ISC

    Unpacked Size

    6.95 kB

    Total Files

    4

    Last publish

    Collaborators

    • cubber