-
-
Save OzanKurt/74ae11bf5c42fe65a08dc2076d98d3e3 to your computer and use it in GitHub Desktop.
A little script to check the size of your localStorage - for management purposes
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
let total = 0, amount, item; | |
for (item in localStorage) { | |
amount = ((localStorage[item].length + item.length) * 2); | |
total += amount; | |
} | |
console.log(`Total = ${(total / 1024).toFixed(2)}KB`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment