nodejs / nodejs/node

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

Aperta
#58,981 7 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

doc
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, node.js
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
64/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.