nodejs / nodejs/node

fs.glob is stable as of v24 but lacks any documentation regarding `pattern` argument

Ouverte
#58,981 7 commentaires 4 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

doc
Langage dominant
JavaScript
Étoiles
122k
Forks
37.3k
Merge moyen
4 j 2 h
PR mergées (30 j)
283

Description

Affected URL(s)

https://nodejs.org/docs/latest/api/fs.html#fsglobpattern-options-callback

Description of the problem

Love that native glob support came to node, however fs.glob is stable as of v24 but lacks documentation regarding pattern argument which is confusing, unhelpful and deterring adoption if you come from plethora of user land implementations. For once it prevents me from using it in my cli (edit files by glob patterns), because I can't tell to my cli's users how to write the patterns.

I'm looking for documentation for glob's aspects: platform support, performance, supported features.

I'd love to see following popular features mentioned. It will help to know if feature is supported or not, if there any caveats and examples showcasing how feature works.

  • Brace Expansion (foo/{1..5}.md, bar/{a,b,c}.js)
  • Extended glob matching, extglobs (+(x|y), !(a|b))
  • "Globstar" ** matching, wildcards (**, *.js)
  • Posix character classes ([[:alpha:][:digit:]])
  • Support for multiple glob patterns
  • Negation ('!a/*.js', '*!(b).js')
  • regex character classes (foo-[1-5].js)
  • regex logical "or" (foo/(abc|xyz).js)

Comparison examples with user land libraries like glob, minimatch, micromatch, fast-glob will be helpful too.

Maybe text based matching (without fs or path involved) can be moved to global or utils packages and documented in depth there?

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Start at the affected fs.glob(pattern, options, callback) documentation URL and review the current pattern argument section. Use the requested feature list, platform support, performance, and user-land library comparisons as a checklist; the work is done when supported behavior, caveats, and representative examples are documented.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, node.js
Domaine
documentation
Type d'issue
Documentation
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
64/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.