caoge c760052ff9 机车状态修改 | пре 8 месеци | |
---|---|---|
.. | ||
node_modules | пре 8 месеци | |
index.js | пре 8 месеци | |
license | пре 8 месеци | |
package.json | пре 8 месеци | |
readme.md | пре 8 месеци |
Convert directories to glob compatible strings
$ npm install dir-glob
const dirGlob = require('dir-glob');
dirGlob(['index.js', 'test.js', 'fixtures']).then(files => {
console.log(files);
//=> ['index.js', 'test.js', 'fixtures/**']
});
dirGlob(['index.js', 'inner_folder'], {
cwd: 'fixtures'
}).then(files => {
console.log(files);
//=> ['index.js', 'inner_folder/**']
});
dirGlob(['lib/**', 'fixtures'], {
files: ['test', 'unicorn']
extensions: ['js']
}).then(files => {
console.log(files);
//=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
});
dirGlob(['lib/**', 'fixtures'], {
files: ['test', 'unicorn', '*.jsx'],
extensions: ['js', 'png']
}).then(files => {
console.log(files);
//=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
});
Returns a Promise
for an array of glob strings.
Returns an array of glob strings.
Type: Array
string
A string
or an Array
of paths.
Type: Array
Append extensions to the end of your globs.
Type: Array
Only glob for certain files.
Type: string
Test in specific directory.
MIT © Kevin Mårtensson