Support "process.stdout.write" in logging
See original GitHub issueHi, i love this project and i wanted to suggest a feature .
i normally use this code to update figures/values on the same line without creating newlines. just like console.log,but it doesn’t create a newline always. Example is when creating a countdown/timer in the terminal.
process.stdout.write(`${currentTime}\r`)
and it works perfectly. But when i add it to the chalk-animation syntax like
chalkAnimation.rainbow(process.stdout.write(`${currentTime}\r`));
i get this error
.../node_modules/chalk-animation/index.js:134
text: str.split(/\r\n|\r|\n/),
^
TypeError: str.split is not a function
Is there any way to do this? Thanks
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Difference between "process.stdout.write" and "console.log" in ...
Thought I share some input to help understand. process.stdout.write doesn't add a new line while console.log does, like others had mentioned.
Read more >Difference between process.stdout.write and console.log in ...
Both process.stdout.write and console.log in NodeJS have basic functionality to display messages on the console. Basically console.log ...
Read more >Using process.stdout in place of console.log
1 - console.log and process.stdout ... For starters just play around with the console.log method and the process.stdout.write method. WHen doing ...
Read more >Digging Into Node.js Console Log & Process stdout
First, questions are asked about how to get information into and out of the program. Then, logging to the console is compared against...
Read more >use console.log instead of process.stdout.write? · Issue #981
To output logs from your function code, you can use methods on the console object, or any logging library that writes to stdout...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found a solution to this.
I created a pr for it #25
Yeah sorry I’m usually away from my computer on weekends.
Is the last example working for you?