UNPKG

readmeasy

Version:

Creates README.md for node modules using any template engine as easy as possible.

48 lines (47 loc) 1.72 kB
import { SupportedEngine } from "measy"; /** @ignore */ export declare const advancedSupportedEngines: Set<SupportedEngine | undefined>; /** * Makes given input array and returns it. * * @ignore * @param input to construct array from * @returns created array. */ export declare function arrify<T>(input?: T | T[]): T[]; /** * Returns top most `package.json` data as an object. * * @ignore * @returns top most `package.json`s data. */ export declare function readPackageJson(dir: string): Promise<Record<string, any>>; /** * Returns README templates file by searching given directory for supported template extensions ordered by path. * * @ignore * @param dir is the directory to search README templates for. * @returns template file paths. */ export declare function findReadMeFiles(dir?: string): Promise<string[]>; /** * Returns README template file by searching given directory for supported template extensions. * If more than one found, returns first one. * * @param dir is the directory to search README template for. * @returns template file path. */ export declare function findTemplateFile(dir?: string): Promise<string | undefined>; /** * Finds or creates README template file and returns the file found or created path. * * @param dir is the directory to search README template for. * @param extension is the extension to be used if template file would be created. * @param defaultContent is the default content to create README template with. * @returns path of the README template. */ export declare function findOrCreateTemplateFile({ dir, templateExtension, defaultContent }?: { dir?: string; templateExtension?: string; defaultContent?: string; }): Promise<string>;