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.

Support "process.stdout.write" in logging

See original GitHub issue

Hi, 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:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
spidyhackxcommented, Apr 29, 2022

I found a solution to this.

I created a pr for it #25

0reactions
bokubcommented, May 4, 2022

Yeah sorry I’m usually away from my computer on weekends.

Is the last example working for you?

Read more comments on GitHub >

github_iconTop 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 >

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