nodejs / nodejs/node

Add console.log() %c support for parity with browsers, Deno, and Bun

Offen
#52,350 3 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

console stale
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

would be fixed by https://github.com/nodejs/node/pull/49205

My attempt at a compat table of ANSI and %c:

%c ANSI
Node.js ☑️
Deno ☑️ ☑️
Bun ☑️ ☑️
Chrome ☑️ ☑️
Firefox ☑️
Safari ☑️ ?

Why this would be a good idea:

  • Feature parity with other desktop JavaScript runtimes like Deno and Bun
  • Allow documentation authors to recommend using %c instead of ANSI for more compatibility without "%c works everywhere except Node.js" clauses
  • %c is ignored in unsupported environments (like current Node.js) whereas ANSI causes jargon to be printed (particularly in Firefox). Thus, encouraging %c is more "progressive enhancement" or "graceful degradation" than ANSI ??

basically just "everyone else is doing it, so it's probably a good idea to conform to what users expect"

previous issue https://github.com/nodejs/node/issues/29605

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit Pull Request #49205 und dem vorherigen Issue #29605 und überprüfe anschließend alle dort identifizierten Formatierungseinstiegspunkte oder Tests für console.log. Als abgeschlossen gilt die Arbeit, wenn Node.js die Formatierung von console.log() mit %c konsistent gemäß dem in diesem Issue beschriebenen Verhalten unterstützt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.