Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use path.posix.join() instead of path.join().
If set to true, globby will automatically glob directories for you. If you define an Array it will only glob files that matches the patterns inside the Array. You can also define an object with files and extensions like below:
Note that if you set this option to false, you won't get back matched directories unless you set onlyFiles: false.
gitignore
Type: boolean
Default: false
Respect ignore patterns in .gitignore files that apply to the globbed files.
Returns an object[] in the format {pattern: string, options: Object}, which can be passed as arguments to fast-glob. This is useful for other globbing-related packages.
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
globby.hasMagic(patterns, options?)
Returns a boolean of whether there are any special glob characters in the patterns.
The maintainers of globby and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
Related
multimatch - Match against a list instead of the filesystem