UNPKG

cnpmcore

Version:
19 lines (18 loc) 1.23 kB
/// <reference types="node" /> import { AuthorType, PackageJSONType } from '../repository/PackageRepository'; export declare const FULLNAME_REG_STRING = "@[^/]{1,220}/[^/]{1,220}|@[^%]+%2[fF][^/]{1,220}|[^@/]{1,220}"; export declare function getScopeAndName(fullname: string): string[]; export declare function getFullname(scope: string, name: string): string; export declare function cleanUserPrefix(username: string): string; export declare function getPrefixedName(prefix: string, username: string): string; export declare function calculateIntegrity(contentOrFile: Uint8Array | string): Promise<{ integrity: string; shasum: string; }>; export declare function formatTarball(registry: string, scope: string, name: string, version: string): string; export declare function detectInstallScript(manifest: any): boolean; /** 判断一个版本压缩包中是否包含 npm-shrinkwrap.json */ export declare function hasShrinkWrapInTgz(contentOrFile: Uint8Array | string): Promise<boolean>; /** 写入 ES 时,格式化 author */ export declare function formatAuthor(author: string | AuthorType | undefined): AuthorType | undefined; export declare function extractPackageJSON(tarballBytes: Buffer): Promise<PackageJSONType>;