Skip to content

tiaanduplessis/fs-find-up

Repository files navigation

fs-find-up

Search up directory tree for specific file(s)



Built with ❤︎ by tiaanduplessis and contributors

Table of Contents

Table of Contents
  • About
  • Install
  • Usage
  • Contribute
  • License
  • About

    Find file(s) by walking up parent directories. Similar to find-up, but adds support for matching using regex and is synchronous by default.

    Install

    $ npm install @tiaanduplessis/fs-find-up
    # OR
    $ yarn add @tiaanduplessis/fs-find-up

    Usage

    const findUp = require('@tiaanduplessis/fs-find-up')
    
    console.log(findUp('index.js'))
    // [ '/Users/Tiaan/Workspace/fs-find-up/index.js' ]
    
    console.log(findUp(['index.js', /.*\.test\.js/])) 
    // [ '/Users/Tiaan/Workspace/fs-find-up/index.js', '/Users/Tiaan/Workspace/fs-find-up/index.test.js' ]
    
    console.log(findUp('foobar.bazbazboom'))
    // []

    Contributing

    Contributions are welcome!

    1. Fork it.
    2. Create your feature branch: git checkout -b my-new-feature
    3. Commit your changes: git commit -am 'Add some feature'
    4. Push to the branch: git push origin my-new-feature
    5. Submit a pull request :D

    Or open up a issue.

    License

    Licensed under the MIT License.

    About

    Search up directory tree for specific file(s)

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Packages

    No packages published