1.0.0 • Published 7 years ago

@tiaanduplessis/fs-find-up v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

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.

1.0.0

7 years ago