question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-detect support for `stderr`

See original GitHub issue

Issuehunt badges

I want use colors only on console.error calls which is typically terminal. I suggest some API extension, very easy idea is chaining like this:

const coloredOutput = chalk.stderr.red('RED ALERT');

This can be used more easily like this:

const chalk = require('chalk').stderr;
const coloredOutput = chalk.red('RED ALERT');

IssueHunt Summary

stroncium stroncium has been rewarded.

Backers (Total: $80.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
langpavelcommented, Nov 14, 2018

I just published chalk-stderrgithubnpmyarn with chalk and supports-color as peer dependencies.

Source:

const supportsColor = require('supports-color');
const Chalk = require('chalk').constructor;
module.exports = new Chalk({ level: supportsColor.stderr.level });
0reactions
issuehunt-app[bot]commented, Sep 22, 2019

@sindresorhus has rewarded $72.00 to @stroncium. See it on IssueHunt

  • 💰 Total deposit: $80.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $8.00
Read more comments on GitHub >

github_iconTop Results From Across the Web

171836 - Allow subprocesses (renderer etc.) to inherit stderr ...
Currently, stderr isn't inherited because Chrome passes bInheritHandles=0 to CreateProcess(). Just changing this to bInheritHandles=1 isn't secure or robust.
Read more >
Create applications - Configuration Manager - Microsoft Learn
Automatically detect application information · General information about the application, like the application Name, Administrator comments, ...
Read more >
Docker WSL2 CUDA support: stdout: , stderr: Auto-detected ...
It is not supported in WSL. So the solution for me was as follows: forget about hopes for WSL; install Windows Server with...
Read more >
Utilities — Click Documentation (7.x)
Last but not least echo() uses click's intelligent internal output streams to stdout and stderr which support unicode output on the Windows console....
Read more >
Console API — Rich 12.6.0 documentation
There are several “standards” for writing color to the terminal which are not all universally supported. Rich will auto-detect the appropriate color system, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found