root 3bf41bf355 update | 1 rok pred | |
---|---|---|
.. | ||
index.js | 1 rok pred | |
license | 1 rok pred | |
package.json | 1 rok pred | |
readme.md | 1 rok pred |
Convert directories to glob compatible strings
$ npm install dir-glob
const dirGlob = require('dir-glob');
(async () => {
console.log(await dirGlob(['index.js', 'test.js', 'fixtures']));
//=> ['index.js', 'test.js', 'fixtures/**']
console.log(await dirGlob(['index.js', 'inner_folder'], {cwd: 'fixtures'}));
//=> ['index.js', 'inner_folder/**']
console.log(await dirGlob(['lib/**', 'fixtures'], {
files: ['test', 'unicorn']
extensions: ['js']
}));
//=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
console.log(await dirGlob(['lib/**', 'fixtures'], {
files: ['test', 'unicorn', '*.jsx'],
extensions: ['js', 'png']
}));
//=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
})();
Returns a Promise<string[]>
with globs.
Returns a string[]
with globs.
Type: string | string[]
Paths.
Type: object
Type: string[]
Append extensions to the end of your globs.
Type: string[]
Only glob for certain files.
Type: string[]
Test in specific directory.