Skip to content

Arrays of globs with negation #82

@aomarks

Description

@aomarks

Currently, tiny-glob takes a single glob string.

It would be nice if it could also take an array of glob strings, where negations apply to previous items in the array.

For example, given the files:

src/foo.js
src/bar.js
src/test/baz.js

then the invocation:

await glob([
  'src/**/*.js',
  '!test'
]);

would return:

src/foo.js
src/bar.js

This syntax is supported by fast-glob (ref), and is common in applications such as .gitignore files, and the package.json files array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions