Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar doesn't show at child_process spawn #154

Open
MikeDevice opened this issue Jun 10, 2017 · 2 comments
Open

Progress bar doesn't show at child_process spawn #154

MikeDevice opened this issue Jun 10, 2017 · 2 comments

Comments

@MikeDevice
Copy link

Here is two files

test.js

var ProgressBar = require('progress');

var bar = new ProgressBar(':bar', { total: 10 });

console.log('ProgressBar');
var timer = setInterval(function () {
  bar.tick();
  if (bar.complete) {
    clearInterval(timer);
  }
}, 100);

index.js

var spawn = require('child_process').spawn;

var ls = spawn('node', ['./test.js']);

ls.stdout.on('data', function(data) {
  console.log(data.toString());
});

If run $ node test.js , progress bar will be rendered, but if run $ node index.js — won't.

@DesignByOnyx
Copy link

By default this writes to the stderr stream. Did you try stderr instead of stdout?

@jfoclpf
Copy link

jfoclpf commented Nov 24, 2022

Progress bar uses by default as strem the stderr, check here.

Can you try using in options the standard output?

var bar = new ProgressBar(':bar', { total: 10, stream: process.stdout });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants