Skip to content

Instantly share code, notes, and snippets.

@JustSteveKing
Created March 2, 2017 15:11
Show Gist options
  • Save JustSteveKing/34dbfa6975dff3cca1cde3bd2592932a to your computer and use it in GitHub Desktop.
Save JustSteveKing/34dbfa6975dff3cca1cde3bd2592932a to your computer and use it in GitHub Desktop.
A little script to check the size of your localStorage - for management purposes
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