UNPKG

closest-file-data

Version:

Allow to find and retrieve some data (such as config file) related to a given path (with cache)

16 lines (15 loc) 442 B
export interface IDataReader<T = any> { basename: string; read: (file: string) => T | void; } export interface IClosestDataResult { readonly path: string; readonly data: any; } declare function closestFileData(relPath: string, oneOrMoreReader: IDataReader | IDataReader[]): IClosestDataResult | void; declare const _default: typeof closestFileData & { cache: { clear: () => any; }; }; export default _default;