XuelesszzZ 94af2b8e7b 6-30-5 | 1 рік тому | |
---|---|---|
.. | ||
index.js | 1 рік тому | |
license | 1 рік тому | |
package.json | 1 рік тому | |
readme.md | 1 рік тому |
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