quota-storage:带配额的 Web 存储

时间:2021-07-12 19:53:39
【文件属性】:
文件名称:quota-storage:带配额的 Web 存储
文件大小:5KB
文件格式:ZIP
更新时间:2021-07-12 19:53:39
JavaScript #配额存储 QuotaStorage 提供了为 Web 存储 API(例如 localStorage)设置自定义配额的可能性。 配额以字符定义,键和值都用于计算。 可以与模块一起使用以创建具有单独配额的命名空间存储实例。 ##Usage var quotaStorage = QuotaStorage.quotaStorage(10, localStorage); quotaStorage.setItem('key', 'val'); // ok 6 chars are now in use quotaStorage.setItem('key2', 'val2'); // throws Error quotaStorage.getItem('key') // returns 'val' quotaStorage.getItem('key2') // returns null 关注以获取
【文件预览】:
quota-storage-master
----package.json(684B)
----test()
--------quota-storage.test.js(2KB)
----LICENSE(1KB)
----lib()
--------quota-storage.js(2KB)
----README.md(2KB)
----bower.json(500B)

网友评论