AJNB 376d9cfaf8 hjj | 2 months ago | |
---|---|---|
.. | ||
index.js | 2 months ago | |
license | 2 months ago | |
package.json | 2 months ago | |
readme.md | 2 months ago |
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.