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 --sizes option #31

Merged
merged 5 commits into from
Feb 6, 2022
Merged

Add --sizes option #31

merged 5 commits into from
Feb 6, 2022

Conversation

marcofugaro
Copy link
Contributor

@marcofugaro marcofugaro commented Nov 28, 2021

Close #22

This PR adds the --sizes option, this is an example usage:

Screenshot 2021-11-28 at 22 03 00

It is done thanks to fast-folder-size to get the folder size and pretty-bytes to format the bytes to be human readable.

Specifically, it relies on this PR simoneb/fast-folder-size#13 of fast-folder-size, where I added the sync options. Otherwise, we would have to rewrite everything using async/await. The new version has been released on npm.

Copy link
Owner

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review, it looks amazing, thanks a lot!

I think I'll probably tweak it a bit to emulate the Linux tree -s more (they just show in bytes)

@yangshun yangshun merged commit a89746c into yangshun:master Feb 6, 2022
@marcofugaro
Copy link
Contributor Author

@yangshun thank you!

I think I'll probably tweak it a bit to emulate the Linux tree -s more (they just show in bytes)

That could be the --bytes option, the idea of this PR was to emulate the linux tree -h command (h stands for human-readable) 🙂

@slorber
Copy link
Collaborator

slorber commented Feb 9, 2022

Hey, just saw this as I had a similar idea

Was thinking it might also be useful to print a file hash in some cases?

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.

[Feature request] File sizes
3 participants