cnpmcore
Version:
Private NPM Registry for Enterprise
21 lines (20 loc) • 1.28 kB
TypeScript
import type { AuthorType, PackageJSONType } from '../repository/PackageRepository.ts';
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 interface Integrity {
integrity: string;
shasum: string;
}
export declare function calculateIntegrity(contentOrFile: Uint8Array | string): Promise<Integrity>;
export declare function formatTarball(registry: string, scope: string, name: string, version: string): string;
export declare function detectInstallScript(manifest: {
scripts?: Record<string, string>;
}): 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>;