Bachir Soussi Chiadmi 0611418f7a added whole system from ola4doc | 7 vuotta sitten | |
---|---|---|
.. | ||
.npmignore | 7 vuotta sitten | |
.travis.yml | 7 vuotta sitten | |
LICENSE | 7 vuotta sitten | |
README.md | 7 vuotta sitten | |
index.js | 7 vuotta sitten | |
package.json | 7 vuotta sitten | |
test.js | 7 vuotta sitten |
Javascript module to extract the non-magic parent path from a glob string.
npm install glob-parent --save
var globParent = require('glob-parent');
globParent('path/to/*.js'); // 'path/to'
globParent('/root/path/to/*.js'); // '/root/path/to'
globParent('/*.js'); // '/'
globParent('*.js'); // '.'
globParent('**/*.js'); // '.'
globParent('path/{to,from}'); // 'path'
globParent('path/!(to|from)'); // 'path'
globParent('path/?(to|from)'); // 'path'
globParent('path/+(to|from)'); // 'path'
globParent('path/*(to|from)'); // 'path'
globParent('path/@(to|from)'); // 'path'
globParent('path/**/*'); // 'path'
// if provided a non-glob path, returns the nearest dir
globParent('path/foo/bar.js'); // 'path/foo'
globParent('path/foo/'); // 'path/foo'
globParent('path/foo'); // 'path' (see issue #3 for details)
See release notes page on GitHub