/** * Finda, a utility for finding common variables and values * * @export * @class Finda */ export declare class Finda { cache: Map; gitPath: string; packageJsonPath: string; constructor(); resetGitPath(value?: string): void; resetPackageJsonPath(value?: string): void; /** * Find author email * * Try to find author email via; * - require(package.json).author.email * * @param {string} [defaultEmail] * @returns {string} * @memberof Finda */ authorEmail(defaultEmail?: string): string; /** * Find author name * * Try to find author name via; * - require(package.json).author.name * * @param {string} [defaultValue] * @returns {string} * @memberof Finda */ authorName(defaultValue?: string): string; /** * Find author URL * * Try to find author URL via; * - require(package.json).author.url * * @param {string} [defaultValue] * @returns {string} * @memberof Finda */ authorUrl(defaultValue?: string): string; /** * Find info from .git/config file * * @param {string} path Path to property ('user.email') * @returns {string} * @memberof Finda */ getFromGitConfig(path: string): string; /** * Find git email address * * Try to find git email address via; * - git config --get user.email * * @returns {string} * @memberof Finda */ gitEmail(): string; /** * Find GitHub Username * * Try to find GitHub Username via; * - sub-string of this.gitEmail() * - require(package.json).repository.url * - require(package.json).repository * - require(package.json).homepage.url * - require(package.json).homepage * * @returns {string} * @memberof Finda */ githubUsername(gitEmail?: string): string; /** * Find git name * * Try to find git name via; * - git config --get user.name * * @returns {string} * @memberof Finda */ gitName(): string; /** * Find package description * * Try to find package description via; * - require(package.json).description * * @param {string} [defaultValue=`A description for ${this.packageName()}`] * @returns {string} * @memberof Finda */ packageDescription(defaultValue?: string): string; /** * Is current directory empty, or does it have a .git directory? * * @param {string} gitPath Path to .git directory * @returns {boolean} * @memberof Finda */ isEmptyDirOrHasGit(gitPath?: string): boolean; /** * Find package destination * * Try to find package destination (directory or path) via; * - resolve path via parameter * - current directory * * @param {string} directoryOrPath * @returns {string} * @memberof Finda */ packageDestination(directoryOrPath: string): string; /** * Find package license * * Try to find package license via; * - require(package.json).license * * @param {string} [defaultValue='MIT'] * @returns {string} * @memberof Finda */ packageLicense(defaultValue?: string): string; /** * Find package name * * Try to find package name via; * - require(package.json).name * * @param {string} [defaultValue=`${this.userName()}-package`] * @returns {string} * @memberof Finda */ packageName(defaultValue?: string): string; /** * Find package repository URL * * Try to find package repository URL via; * - require(package.json).repository.url * - require(package.json).repository * * @param {*} [username=this.userName()] * @param {string} packageName * @returns {string} * @memberof Finda */ packageRepository(username?: string, packageName?: string): string; /** * Find package version * * Try to find package version via; * - require(package.json).version * * @param {string} [defaultVersion='0.0.0'] * @returns {string} * @memberof Finda */ packageVersion(defaultVersion?: string): string; /** * Find username * * Try to find username via; * - require(package.json).repository.url * - require(package.json).repository * - require(package.json).homepage.url * - require(package.json).homepage * - require(package.json).author.email * - require(package.json).author * * @param {*} [defaultValue=this.githubUsername()] * @returns {string} * @memberof Finda */ username(defaultValue?: string): string; /** * Get value from a property in package.json file * * @param {string} path * @param {*} [defaultValue] * @returns {*} * @memberof Finda */ _getFromPackage(path: string, defaultValue?: any): any; } export declare const finda: Finda; export default finda;