Skip to content

Switch from globby to native glob after dropping Node 20 support #958

@bmish

Description

@bmish

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


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