findup-sync
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/findup-sync package

    4.0.0 • Public • Published

    findup-sync

    NPM version Downloads Azure Pipelines Build Status Travis Build Status AppVeyor Build Status Coveralls Status Gitter chat

    Find the first file matching a given pattern in the current directory or the nearest ancestor directory.

    Matching is done with micromatch, please report any matching related issues on that repository.

    Usage

    var findup = require('findup-sync');
    findup(patternOrPatterns [, micromatchOptions]);
     
    // Start looking in the CWD.
    var filepath1 = findup('{a,b}*.txt');
     
    // Start looking somewhere else, and ignore case (probably a good idea).
    var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});

    API

    findup(patterns, [options])

    • patterns {String|Array}: Glob pattern(s) or file path(s) to match against.
    • options {Object}: Options to pass to micromatch. Note that if you want to start in a different directory than the current working directory, specify a cwd property here.
    • returns {String}: Returns the first matching file.

    License

    MIT

    Install

    npm i findup-sync

    DownloadsWeekly Downloads

    7,938,120

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    7.12 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar