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

Add a hours:minutes:seconds ETA #85

Closed
wants to merge 6 commits into from

Conversation

cmizzi
Copy link

@cmizzi cmizzi commented Mar 6, 2015

For work projects, I need to use a progress bar with nodeJS and, I think that is could be cool to have a hours, minutes and seconds ETA for long download.

@callumlocke
Copy link

+1

@hallas
Copy link
Contributor

hallas commented Apr 13, 2015

@jdan Can you take a look?

@jdan
Copy link
Collaborator

jdan commented Apr 14, 2015

Heya @cmizzi, thanks for the PR.

To be perfectly honest I'm not sure how I feel adding more tokens. I think a better solution might be to just allow users to pass in their own token formatters.

var bar = new ProgressBar('  downloading [:bar] :percent :etas', {
    complete: '=',
    incomplete: ' ',
    width: 20,
    total: len,
    tokens: {
      // maybe not `eta` here specifically...
      ':hour': function(eta) {
        return ...
      }
    }
  });

Thoughts?

@cmizzi
Copy link
Author

cmizzi commented Apr 15, 2015

It could be a good job but it makes user recreate a child module if they don't want specify each time custom tokens.

@lbeschastny
Copy link

@jdan totally agree with you about keeping the number of tokens small.

Though, it'll be nice for node-progress to pretty-print :eta either by some flag, or by default (something like #75).

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

Successfully merging this pull request may close these issues.

None yet

6 participants