# render-package **Repository Path**: x-render-ydb/render-package ## Basic Information - **Project Name**: render-package - **Description**: 用于下载npm包的工具类 - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-04 - **Last Updated**: 2024-02-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # `@x.render/render-package` > render 中封装的下载 npm 包的类 ## Usage ``` import Package = require('@x.render/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; getNpmPkgLatestVersion(): Promise; install(version?: string): Promise; canIInstall(): Promise; isLocalPkgExist(version: string): Promise; update(): Promise; deleteOldVersionPkg(): Promise; localPkgPath(version: string): string; getPkgCachePath(): Promise; } export = Package; ```