Skip to content

chore: replace glob with native node:fs globSync#1803

Closed
roli-lpci wants to merge 1 commit intodonmccurdy:mainfrom
roli-lpci:chore/replace-glob-with-native-fs
Closed

chore: replace glob with native node:fs globSync#1803
roli-lpci wants to merge 1 commit intodonmccurdy:mainfrom
roli-lpci:chore/replace-glob-with-native-fs

Conversation

@roli-lpci
Copy link

Summary

  • Replace glob package usage with native node:fs globSync in scripts/validate.cjs and packages/core/test/io/node-io.test.ts
  • Modernize require('fs') / require('path') to require('node:fs') / require('node:path') in the validate script

The glob package was never listed as a direct dependency — it was accessed via hoisting from transitive dependencies. Native fs.globSync (available since Node.js 22) provides the same functionality with zero external dependencies, and CI already tests on Node.js v22+.

Closes #1800

Closes donmccurdy#1800

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@donmccurdy
Copy link
Owner

donmccurdy commented Feb 26, 2026

Thanks @roli-lpci! For the uses that were previously async — could you use import {glob} from 'node:fs/promises'; instead?

@donmccurdy donmccurdy added code health dependencies Pull requests and issues related to dependencies labels Feb 26, 2026
@donmccurdy donmccurdy added this to the 🗄️ Backlog milestone Feb 26, 2026
@roli-lpci
Copy link
Author

Good call — I'll update the async paths to use import { glob } from 'node:fs/promises' instead. Let me check the minimum Node version to make sure fs.promises.glob is available (it landed in Node 22).

What's the project's minimum supported Node version? If it's >= 22, I'll switch to the native async glob. If < 22, I could use fs.promises.readdir with { recursive: true } and filter by extension as a fallback.

@donmccurdy
Copy link
Owner

Hm, I'm getting the impression that this change is part of an experiment in generating many PRs, in bulk, with an LLM. I'd prefer that my projects not be included in these experiments. Thank you.

@donmccurdy donmccurdy closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health dependencies Pull requests and issues related to dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove 'glob' dependency

2 participants