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

feat: @std/cli should have a progress bar function #6374

Open
BlackAsLight opened this issue Jan 31, 2025 · 4 comments · May be fixed by #6378
Open

feat: @std/cli should have a progress bar function #6374

BlackAsLight opened this issue Jan 31, 2025 · 4 comments · May be fixed by #6378

Comments

@BlackAsLight
Copy link
Contributor

The @std/cli has a spinner function to display the fact that something is loading, likewise we should also have a progress bar function that enables us to show the progress of something happening.

@timreichen
Copy link
Contributor

I am in favour of adding this to std.
What should it look like by default and what should be customizable?
There are many different cli progress bar styles in cli land, some with, some without percentage and/or n/m displays, prefixes, suffixes etc.
[####----------------], [####----------------] 20%, [####----------------] 4/20
[###>----------------], [###>----------------] 20%, [###>----------------] 4/20
[===>----------------], [===>----------------] 20%, [===>----------------] 4/20
[■■■■□□□□□□□□□□□□□□□□], [■■■■□□□□□□□□□□□□□□□□] 20%, [■■■■□□□□□□□□□□□□□□□□] 4/20
▓▓▓▓░░░░░░░░░░░░░░░░, ▓▓▓▓░░░░░░░░░░░░░░░░ 20%, ▓▓▓▓░░░░░░░░░░░░░░░░ 4/20

@andrewthauer
Copy link
Contributor

I think it probably should be customizable for the bars and percentage at a minimum. Having it templated would also be nice probably.

I've used both @deno-library/progress and dax for this and both seem to work well for my purposes.

@BlackAsLight
Copy link
Contributor Author

I think by default it should look the same as deno has when updating, but the progress bar characters should be customisable, along with showing an actual percentage and some way to communicate a rate of some sort.

@andrewthauer
Copy link
Contributor

andrewthauer commented Feb 1, 2025

I also use number of steps vs a percentage quite often for the progress labelling. I don't recall what the Deno default is, but I'm somewhat partial to [============] style as a basic/non fancy default.

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 a pull request may close this issue.

3 participants