///
export interface Info {
description?: string;
npmName?: string;
repoName?: string;
githubUser?: string;
usage: (command: string) => string | undefined;
fileContent?: string;
fileName?: string;
filePath?: string;
heading?: string;
npxExecutable?: string;
globalExecutable?: string;
info: Info;
}
interface PackageJSON {
name?: string;
usage?: string;
description?: string;
bin?: {
[key: string]: string;
} | string;
repository?: {
type?: string;
url?: string;
};
}
export declare class Pkg {
pkg: PackageJSON;
constructor(pkg: PackageJSON);
static fileExists(fileName: string): Promise;
static load(process: NodeJS.Process): Promise;
parseRepo(): {
githubUser: string;
repoName: string;
repository: string;
};
get npmName(): string | undefined;
get repoName(): string | undefined;
get githubUser(): string | undefined;
get description(): string | undefined;
get heading(): string | undefined;
get isScoped(): boolean | "" | undefined;
get npxExecutable(): string | undefined;
get globalExecutable(): string | undefined;
get usage(): (command: string) => string;
static info(process: NodeJS.Process): Promise>;
}
export declare class Template {
static info>(info: T): Info;
static readFile(filePath: string): Promise;
static load(fileName: string, process: NodeJS.Process): Promise<{
info: Info;
update: (content: string) => Promise;
}>;
static update(filePath: string, content: string): Promise;
}
export declare class ReadMe {
static badges({ repoName, npmName, githubUser, }: Info): {
[key: string]: {
link: string;
image: string;
};
};
static badgeMarkdown(info: Info): string[];
static npmInstall({ npmName, globalExecutable, usage }: Info): string[];
static npxRun({ npxExecutable, usage }: Info): string[];
static transform({ heading, fileContent, info, description }: Info): string;
static update(process: NodeJS.Process): Promise;
static cli(process: NodeJS.Process): Promise;
}
export {};