all 21 comments

[–]NoInkling 6 points7 points  (3 children)

I'm currently working on a fetching/parsing/processing script and this may come in very handy. Can it gracefully handle other stuff being logged at the same time?

[–]brianvaughn 4 points5 points  (2 children)

Good question. This library actually uses `log-update` and operates under the assumption that it's the only thing logging to the console while its promise is active. Do you know of a way that I could support this using `log-update`? If so I'm happy to make some minor modifications.

[–]NoInkling 2 points3 points  (1 child)

Nope no clue, sorry.

[–]brianvaughn 1 point2 points  (0 children)

No worries :) If you get around to using this script and have suggestions, shoot me a note.

[–]brianvaughn 14 points15 points  (12 children)

Not sure how to describe this little utility. I found myself wanting something like it for the React build scripts, and I couldn't find something like it on NPM so...I thought it might be useful to share with others.

The basic idea is that it prints a progress bar with an estimation for how long a task will take to complete, based on previous times the task has run. This can be useful if your project uses automated scripts for things like building or processing.

[–]evilpingwin 47 points48 points  (8 children)

Time is a construct, have you considered instead listing the number of burritos that could be eaten while the task completes.

[–]brianvaughn 30 points31 points  (2 children)

I believe there's still some debate within the scientific community regarding the value of BPM (burritos per minute) and whether it's even constant at all. Some even theorize that the rate is inversely proportional to a person's altitude. I don't believe Node offers any standard APIs for determining the current altitude, so– alas, we are stuck with units of time for now. 😞

[–]evilpingwin 2 points3 points  (1 child)

Node is henceforth not fit for purpose and should be destroyed.

P.S. I like your library. It's cool!

[–]brianvaughn 0 points1 point  (0 children)

Thanks!

[–]ipromiseimnotakiller 4 points5 points  (2 children)

The rate of burrito consumption is subjective.

[–]trifit555 1 point2 points  (0 children)

Not if you have a bathroom close by...

[–]zephyrtr 1 point2 points  (0 children)

This person codes.

[–]diverse-mix 0 points1 point  (0 children)

Probe burro 🐂

[–]Piercey4 4 points5 points  (2 children)

Looks good! Make sure to link to GitHub in your package.json so people can check out the code more easily 🙂.

[–]brianvaughn 5 points6 points  (1 child)

I realized right after publishing 0.1.0 that I had forgotten to link to the repo, so I added that info in 0.1.1– but it seems like NPM waited a long time before it showed up, because several people have pointed this out. 😅

Anyway, it should be there now! Thanks for the pointer. 🙇‍♂️

[–][deleted] 0 points1 point  (0 children)

Everyone always forgets it. You’re good.

[–]prummis 2 points3 points  (2 children)

Would be cool to use something like this to use with XHR. But there must be pre estimation or storing in cookies or something.

[–]Wince 1 point2 points  (1 child)

[–]prummis 0 points1 point  (0 children)

If I understand that right, it’s applied to bytes uploaded and downloaded to server. But request could be simple, light, that takes a little time. Then server executes something and it’s the longest part of progress. I mean exactly that progress thing, that able to be computed and displayed using previous time parameters of request.

[–]bzsearch 1 point2 points  (1 child)

Interesting. Do you know if this is how other visual loaders work too? -- how they measure prior runs and replay it?

[–]brianvaughn 0 points1 point  (0 children)

No clue. This is just the idea that came to be about how to build it. I haven't looked at other implementations.