Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/metaory/simple-find-file-recursively-up

returns the path at which a provided pattern exists, checking the current directory and any parent folders recursively up
https://github.com/metaory/simple-find-file-recursively-up

npm npm-package

Last synced: about 18 hours ago
JSON representation

returns the path at which a provided pattern exists, checking the current directory and any parent folders recursively up

Awesome Lists containing this project

README

        

simple find file recursively up
===============================

Installation
============
npm i simple-find-file-recursively-up

Usage
=====

```javascript
const findFileRecursivelyUp = require('simple-find-file-recursively-up')

// Pass filename
const found = findFileRecursivelyUp('config.yml')
// /home/meta/dev/project-x/.circleci/config.yml

// pass file path suffix
const found = findFileRecursivelyUp('.mxflow/config.yml')
// /home/meta/.mxflow/config.yml

// pass non-existing path
const found = findFileRecursivelyUp('file-that-dont-exist.csv')
// null
```