1.0.0 • Published 7 years ago
@tiaanduplessis/fs-find-up v1.0.0
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!
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Or open up a issue.
License
Licensed under the MIT License.
1.0.0
7 years ago