# Object wx.getStorageInfoSync()
The synchronous version of wx.getStorageInfo.
# Return Values
# Object object
Property | Type | Description |
---|---|---|
keys | Array.<string> | All keys in the current storage |
currentSize | number | Current space occupied (in KB) |
limitSize | number | Space size limit (in KB) |
# Sample Code
wx.getStorageInfo({
success (res) {
console.log(res.keys)
console.log(res.currentSize)
console.log(res.limitSize)
}
})
try {
const res = wx.getStorageInfoSync()
console.log(res.keys)
console.log(res.currentSize)
console.log(res.limitSize)
} catch (e) {
// Do something when catch error
}