Skip to content

Refactor/use node fs glob#571

Open
gafreax wants to merge 3 commits intofastify:mainfrom
gafreax:refactor/use-node-fs-glob
Open

Refactor/use node fs glob#571
gafreax wants to merge 3 commits intofastify:mainfrom
gafreax:refactor/use-node-fs-glob

Conversation

@gafreax
Copy link
Copy Markdown

@gafreax gafreax commented Apr 11, 2026

This PR resolves issue #551 by replacing the external glob dependency with the native glob utility provided by node:fs/promises.

Key Implementation Details:

  • Dependency Removal: Completely removed the external glob package, reducing the dependency tree.
  • Native Globbing: Implemented for await...of glob(...) to asynchronously scan directories when wildcard: false is used.
  • Symlink Support: Since the native Node.js glob does not follow directory symbolic links by default, a custom recursive scanQueue and visitedDirs mechanism was added to preserve existing symlink behavior and prevent infinite loops on circular symlinks.
  • Filtering: Adopted the native path.matchesGlob to handle the globIgnore filtering logic.
  • Note on Node.js Compatibility:

Because this implementation utilizes path.matchesGlob, it relies on APIs introduced in Node.js v22.0.0 (and glob from node:fs/promises available in v22.0.0 / v20.15.0).

Open Source Saturday Turin

Checklist

@gafreax gafreax force-pushed the refactor/use-node-fs-glob branch from a72ddd0 to 6735951 Compare April 11, 2026 14:47
@gafreax gafreax force-pushed the refactor/use-node-fs-glob branch from 6735951 to 38c2b4d Compare April 11, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant