A simple, lightweight JavaScript API for handling browser localStorage , it is easy to pick up and use, has a reasonable footprint 2.36kb(gzipped: 1.04kb), and has no dependencies.
OTHER License
Bot releases are hidden (Show)
dist/store.js 4.67kb(gzipped: 1.50kb)
dist/store.min.js 2.09kb(gzipped: 0.97kb)
dist/store.esm.js 4.09kb(gzipped: 1.38kb)
dist/store.cjs.js 4.11kb(gzipped: 1.39kb)
dist/store.js 4.66kb(gzipped: 1.50kb)
dist/store.min.js 2.08kb(gzipped: 0.97kb)
dist/store.esm.js 4.08kb(gzipped: 1.38kb)
dist/store.cjs.js 4.10kb(gzipped: 1.39kb)
Published by jaywcjlove over 9 years ago
Published by jaywcjlove over 9 years ago
store(key, data); //单个存储字符串数据
store({key: data, key2: data2}); //批量存储多个字符串数据
store(key); //获取key的字符串数据
store(); //获取所有key/data
store(false); //清空所有key/data
store(key,false); //删除key包括key的字符串数据
store.set(key, data[, overwrite]);//=== store(key, data);
store.setAll(data[, overwrite]); //=== store({key: data, key2: data});
store.get(key[, alt]); //=== store(key);
store.getAll(); //=== store();
store.clear(); //=== store(false);
store.remove(key); //===store(key,false)
store.keys(); //返回所有key的数组
store.forEach(callback); //循环遍历,返回false结束遍历
store.has(key); //⇒判断是否存在返回true/false