readmeasy
Version:
Creates README.md for node modules using any template engine as easy as possible.
28 lines (27 loc) • 1.45 kB
TypeScript
import { SupportedEngine } from "measy";
import { findOrCreateTemplateFile, findTemplateFile } from "./utils";
/**
* Creates README.md from REDAME template.
* @param options are the options.
*/
export default function createReadMe(options?: {
/** Directory to serach README template. */
dir?: string;
/** js, ts, JSON5 or YAML files to get data to be passed to template under a key same as file name. */
contextFiles?: string | string[];
/** js, ts, JSON5 or YAML files to get data to be passed to template. */
rootContextFiles?: string | string[];
/** Paths of directories which contains partial files. */
partialDirs?: string | string[];
/** Template engine to be used. Supports engines supported by consolidate (https://www.npmjs.com/package/consolidate). Defaults to `partials`. */
engine?: SupportedEngine;
/** Files to get filter/helper functions prefixed with file name. i.e "uc()" func in "path/helper.js" becomes "helperUc" helper/filter. */
functionFiles?: string | string[];
/** Files to get filter/helper functions prefixed with file name. i.e "uc()" func in "path/helper.js" becomes "uc" helper/filter. */
rootFunctionFiles?: string | string[];
/** File extension of the template. */
templateExtension?: string;
/** Default content to create README template with. */
defaultContent?: string;
}): Promise<void>;
export { findOrCreateTemplateFile, findTemplateFile };