How to ignore searching inside `node_modules` · Issue #79 · terkelg/tiny-glob · GitHub
Skip to content

How to ignore searching inside node_modules #79

Open

Description

@vjpr

Using !(node_modules)/**/package.json still seems to search within node_modules...or at least its still very slow compared to every other library I'm testing.

Activity

  1. Krinkle commented on Oct 22, 2021

    @Krinkle

    I addresed a similar use case in QUnit sometime ago using picomatch incombination with a recursive fs.readdir call (for gathering files), and node-watch for performant watching over an entire project (and exclude node_modules):

    qunitjs/qunit@b7fb112

    I switched the "gather files" part from picomatch to tiny-glob in the above change, because I found it to make the code simpler (and probably faster too). If you need to gather all files but not enter node_modules, I would restructured the call so as to invoke glob separately for the top-level directories and skip node_modules at that level, and use glob only for recursing within each of the top-level directories.

  2. vjpr commented on Oct 22, 2021

    @vjpr
    Author

    In a monorepo this won't work - there will be 100s of nested node_modules. tiny-glob needs to have a way to not enter dirs.

  3. IanVS commented on Sep 29, 2022

    @IanVS

    Agree, without this feature, I can't adopt tiny-glob, which I was planning to do for storybook.

  4. chdh commented on Dec 28, 2022

    @chdh

    It's probably easier to add an exclude option to prevent traversing of unwanted directories.

    see #74
    see How to exclude directory from reading? for fast-glob

  5. techsin commented on May 2, 2024

    @techsin

    any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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