Skip to content

path: add escapeGlob and unescapeGlob - #61269

Open
Xstoudi wants to merge 13 commits into
nodejs:mainfrom
Xstoudi:feat/glob-escape
Open

path: add escapeGlob and unescapeGlob#61269
Xstoudi wants to merge 13 commits into
nodejs:mainfrom
Xstoudi:feat/glob-escape

Conversation

@Xstoudi

Copy link
Copy Markdown
Contributor

path: add escapeGlob and unescapeGlob

Expose minimatch escaping and unescaping capabilities on path module.

Fixes: #61258

This is an implem proposal fix#61258 using minimatch that is already-vendored. Also feel free to -1 the change if you think it doesn't have its place there.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/path

@nodejs-github-botnodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. labels Jan 4, 2026
@codecov

codecovBot commented Jan 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.15%. Comparing base (9041ad0) to head (e7ed644).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #61269 +/- ##
==========================================
+ Coverage 90.12% 90.15% +0.02% 
==========================================
Files 743 743 Lines 242324 242368 +44 Branches 45629 45635 +6 ==========================================
+ Hits 218396 218501 +105 + Misses 15440 15359 -81 - Partials 8488 8508 +20 
Files with missing linesCoverage Δ
lib/internal/fs/glob.js91.51% <100.00%> (+0.24%)⬆️
lib/path.js97.51% <100.00%> (+0.02%)⬆️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkelleravivkeller added semver-minor PRs that contain new features and should be released in the next minor version. notable-change PRs with changes that should be highlighted in changelogs. labels Jan 4, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The notable-changePRs with changes that should be highlighted in changelogs. label has been added by @avivkeller.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

@Xstoudi

Copy link
Copy Markdown
ContributorAuthor

Hey, no interest?

@nodejs/path

@targos

Copy link
Copy Markdown
Member

@nodejs/path @nodejs/fs

Comment threaddoc/api/path.md Outdated
Comment threadtest/parallel/test-path-unescapeglob.js
Comment threadlib/path.js Outdated
@TheOneTheOnlyJJ

Copy link
Copy Markdown
Contributor

I am wondering, why not just expose minimatch? It's already vendored, right?

@Xstoudi

Copy link
Copy Markdown
ContributorAuthor

Vendoring is an implem detail, not a commitment and I'd prefer to not couple the Node's API to a third-party dependency.

Goal here is to provide stable, cross-platform glob semantic in Node rather than exposing raw minimatch behavior. windowsPathsNoEscape and magicalBraces are good illustrations of this.

@jazellyjazelly added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 2, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Xstoudi

Copy link
Copy Markdown
ContributorAuthor

Hey, is there something blocking this PR?

@valler

Copy link
Copy Markdown

The test cases don't include patterns containing parentheses ( and ). Is this intentional?

@Xstoudi

Copy link
Copy Markdown
ContributorAuthor

No, I'll add some

@avivkelleravivkeller added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 23, 2026
@avivkeller

Copy link
Copy Markdown
Member

@Xstoudi Please rebase

Expose minimatch escaping and unescaping capabilities on path module.
Fixes: nodejs#61258
Signed-off-by: Xavier Stouder <xavier@stouder.io>
@avivkelleravivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 25, 2026
@github-actionsgithub-actionsBot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔ Jenkins credentials valid
- Querying data for job/node-test-pull-request/72403/
[SyntaxError: Unexpected token '<', ..." https://github.com/nodejs/node/actions/runs/30165172379

@trivikrtrivikr added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jul 26, 2026
@github-actionsgithub-actionsBot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jul 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔ Jenkins credentials valid
- Querying data for job/node-test-pull-request/72403/
[SyntaxError: Unexpected token '<', ..." https://github.com/nodejs/node/actions/runs/30182123250

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

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs that need a full CI run.notable-changePRs with changes that should be highlighted in changelogs.pathIssues and PRs related to the path subsystem.request-ci-failedAn error occurred while starting CI via request-ci label, and manual interventon is needed.semver-minorPRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

path.escapeGlob

9 participants

@Xstoudi@nodejs-github-bot@targos@TheOneTheOnlyJJ@valler@avivkeller@MoLow@jazelly@trivikr