UNPKG

look-it-up

Version:

Find a file or directory by walking up parent directories recursively. Zero dependency.

13 lines (8 loc) 535 B
declare type MatcherResult = string | null | symbol; declare type Matcher = string | ((dir: string) => MatcherResult | Promise<MatcherResult>); declare type MatcherSync = string | ((dir: string) => MatcherResult); declare const lookItUp: (matcher: Matcher, dir?: string) => Promise<string | null>; declare const lookItUpSync: (matcher: MatcherSync, dir?: string) => string | null | never; declare const exists: (path: string) => Promise<boolean>; declare const stop: unique symbol; export { exists, lookItUp, lookItUpSync, stop };