Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Use pretty-bytes for file sizes #7

Closed
jeffposnick opened this issue Jan 16, 2015 · 2 comments
Closed

Use pretty-bytes for file sizes #7

jeffposnick opened this issue Jan 16, 2015 · 2 comments
Assignees

Comments

@jeffposnick
Copy link
Contributor

@sindresorhus's https://github.com/sindresorhus/pretty-bytes can replace the function at https://github.com/jeffposnick/sw-precache/blob/00c2b0bc7ab785cae7446b3a166e83435c644f02/sw-precache.js#L43-L53

@jeffposnick jeffposnick self-assigned this Jan 16, 2015
@rmacklin
Copy link
Contributor

@jeffposnick This change also changed the output from KB (1024 bytes) to kB (1000 bytes), which is inconsistent with how Chrome's network tab displays file sizes (as well as how ls usually displays file sizes). Since Chrome displays the size in KB, I think having the tool output sizes in kB can be confusing. I can understand generally wanting to use npm packages instead of hand-rolled functions, but in this case the function was pretty simple and I think replacing it with pretty-bytes was actually a downgrade due to the KB/kB mismatch.

Is there any chance you'd be open to a PR reverting f201914, or is that outside the scope of maintenance for this repository (given that it's kind of deprecated by workbox)?

@jeffposnick
Copy link
Contributor Author

I don't believe that this is something we'd change at this point in sw-precache's lifespan.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants