Recursively extract/find/search non-glob (real/file/base) path from/in glob pattern or array of glob patterns using is-glob. Actually default returns
dirname
that isnt looks like glob. But you can provide another criteria.
Install
npm i --save glob2fp
npm test
Features
- get real path from glob pattern or array of glob patterns
- support defining another criteria, default is based on
dirname
(nearest non-glob dirname) - recursively lookup
glob2fp
For more use-cases see the tests Recursively extract real path from glob pattern
fp
{Array|String} glob pattern(s)opts
{Object} only availableoptions.criteria
functionreturns
{Array|String}
Example
var glob2fp = ;;//=> 'a/b/c';//=> 'a/b/c';//=> 'a/b/c/foo/e';//=> 'a/b';//=> ''
Or array of glob patterns
;//=> [ 'a/b/c' 'a/b/c' 'a/b/c/foo/e' 'a/b' 'a' 'a/b'
Author
Charlike Mike Reagent
License
Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
Released under the MIT
license.
Powered and automated by kdf, February 10, 2015