Add console.log() %c support for parity with browsers, Deno, and Bun
Open
Nobody has claimed this yet.
console
stale
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pull request #49205 and the previous issue #29605, then review any console.log formatting entry points or tests identified there. Done means Node.js supports console.log() %c formatting consistently with the behavior described in this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100