Add simplifyFileSize option - #114
Conversation
I added a new option to enable to show the files in B, MB, GB, TB, PB. Not sure if I need to divide the size by 1024 or 1000. Feedback will be appreciated.
UlisesGascon
left a comment
There was a problem hiding this comment.
Thanks for this proposal @KroshSputnik! Can you include tests and documentation?
|
Currently we support Node@0.8 so new ES6 syntax is not allowed: |
Fixed the es6 issue of using `const`.
Updated readme about the new functionality
Hi @UlisesGascon I've added docs in readme and fixed the es6 issue. Thanks |
Created tests for the new `simplifyFileSize` option.
|
@UlisesGascon I have added test, for when the option is enabled and when it isnt. Can you double check my pull request. |
|
It looks great, although we could probably delegate that logic to bytes instead of handling it ourselves. |
Now using the package bytes, to convert.
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
|
@bjohansebas Updated the feature with your suggestion. |
|
Great! Once the tests are run, I'll be able to give my LGTM |
Added the decimal places.
UlisesGascon
left a comment
There was a problem hiding this comment.
Thanks for include the tests and make the changes to support Node@0.8 @KroshSputnik! :)
I added some suggestions, I think that we will need to modify the HISTORY.md to include the new dependency and the feature too 👍
simplifyFileSize option
Supporting Node@0.8 versions. Co-authored-by: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Added another check for default config. Co-authored-by: Ulises Gascón <ulisesgascongonzalez@gmail.com>
History about new simplifyFileSize feature and dependency of bytes.
|
@UlisesGascon All tasks completed. If need anything else, let me know. |
|
mmm.. not sure why one of the new tests is failing 🤔. Can you have a look @KroshSputnik ? |
|
I think the issues due to the differences of how linux and windows calculate bytes. I downgraded to node 0.8, but all tests pass successfully. |
bjohansebas
left a comment
There was a problem hiding this comment.
Now, since a v2 is being planned, what if we make this the default behavior so no option has to be passed? Also, I think this should go into v2 and we should focus on that.
also for unblock this #145
I added a new option to enable to show the files sizes in B, MB, GB, TB, PB.
Enable it in the options by doing
'simplifyFileSize':trueNot sure if I need to divide the size by 1024 or 1000.
Also would I need to round the final size, as it seems the size returned for the file size is already rounded.
Feedback will be appreciated.