Last active
September 12, 2021 20:14
-
-
Save avoidwork/4698968 to your computer and use it in GitHub Desktop.
filesize.js examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filesize(500); // "500 B" | |
filesize(500, {bits: true}); // "4 kbit" | |
filesize(265318, {base: 2}); // "259.1 KiB" | |
filesize(265318); // "265.32 kB" | |
filesize(265318, {round: 0}); // "265 kB" | |
filesize(265318, {output: "array"}); // [265.32, "kB"] | |
filesize(265318, {output: "object"}); // {value: 265.32, symbol: "kB", exponent: 1, unit: "kB"} | |
filesize(1, {symbols: {B: "Б"}}); // "1 Б" | |
filesize(1024); // "1.02 kB" | |
filesize(1024, {exponent: 0}); // "1024 B" | |
filesize(1024, {output: "exponent"}); // 1 | |
filesize(265318, {standard: "jedec"}); // "259.1 KB" | |
filesize(265318, {base: 2, fullform: true}); // "259.1 kibibytes" | |
filesize(12, {fullform: true, fullforms: ["байтов"]}); // "12 байтов" | |
filesize(265318, {separator: ","}); // "265,32 kB" | |
filesize(265318, {locale: "de"}); // "265,32 kB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment