check-dependency-version-consistency icon indicating copy to clipboard operation
check-dependency-version-consistency copied to clipboard

Switch from globby to native glob after dropping Node 20 support

Open bmish opened this issue 1 month ago • 0 comments


Title: Replace globby with native fs.glob() when Node 20 support is dropped

Labels: enhancement, dependencies


Description:

Node.js v22 introduced native glob support via fs.glob() and fs.globSync(). Once we drop Node 20 support, we can remove the globby dependency and use the built-in alternative.

Current usage

lib/workspace.ts:

import { globbySync } from 'globby';

return globbySync(workspace, {
  onlyDirectories: true,
  cwd: root,
  ignore: ['**/node_modules', ...exclusionPatterns],
});

Native equivalent

import { globSync } from 'node:fs';

return globSync(workspace, {
  cwd: root,
  exclude: (name) => name === 'node_modules' || exclusionPatterns.some(p => p.test(name)),
}).filter(entry => entry.isDirectory()).map(entry => entry.name);

Requirements

  • [ ] Drop Node 20 support (update engines to >=22)
  • [ ] Node 20 LTS ends April 2026

Benefits

  • One fewer runtime dependency
  • Native performance
  • Reduced install size

References


bmish avatar Jan 03 '26 16:01 bmish