Last active
August 29, 2015 13:57
-
-
Save sgimeno/9685555 to your computer and use it in GitHub Desktop.
Getting localStorage usage
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
var usageInBytes = (encodeURI(JSON.stringify(localStorage)).split(/%..|./).length - 1); | |
var usageInKbytes = (encodeURI(JSON.stringify(localStorage)).split(/%..|./).length - 1)/1024; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment