christian 4571a14169 android fix | vor 4 Jahren | |
---|---|---|
.. | ||
index.js | vor 4 Jahren | |
license | vor 4 Jahren | |
package.json | vor 4 Jahren | |
readme.md | vor 4 Jahren |
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.