store.js

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

Downloads
14.8K
Stars
413
Committers
8

Bot releases are hidden (Show)

store.js -

Published by jaywcjlove almost 4 years ago

  • 166037e: Add TS definitions (close #5)
  • ebf0b62: Fix ignored falsy values when getting with multiple keys
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)
store.js -

Published by jaywcjlove almost 5 years ago

  • 068df9d: chore: Upgrade rollup v0.66.1 to v1.27.14
  • 1361828: Add store.get test case.
  • 11f4223: Add store.get test case.
  • 377a9d5: Enhance store.get.
  • 246f93e: Modify test case.
  • 857d798: Add dealIncognito description.
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)
store.js -

Published by jaywcjlove almost 6 years ago

  • Delete redundant code. #13 fff5d90
  • Add test case. db84144
  • Fix test case error. 9fea7f1
  • Update badges. 6e8f5a4
  • Update .gitinore 3acc780
  • Update .travis.yml 50c308b
  • Add English document. 57823f3
  • Replace test tool. tape => jest 7ba3b9d
store.js -

Published by jaywcjlove about 6 years ago

  • ffbb718: Optimize the inital object
  • 18703a0: Fix common name.
store.js -

Published by jaywcjlove over 6 years ago

  1. 1a6f590: Add CommonJS support.
  2. 181ef85: Change the compilation tools.
  3. f5aea3c: Format the code.
  4. 6cac71b: Add editor config.
store.js -

Published by jaywcjlove over 7 years ago

  • 9049d0f: fix: Error: QuotaExceededError by @Joey-93
store.js -

Published by jaywcjlove over 7 years ago

  • Fix the error in the has method in the Safari browser.
  • Add test cases.
  • #4 isJSON 方法修复
  • 添加store('?key') 或者 store.get('?key')判断key是否存在
store.js -

Published by jaywcjlove over 8 years ago

  1. 添加search方法
  2. 添加search方法测试用例
store.js -

Published by jaywcjlove over 8 years ago

  1. 重构store.js
  2. 删除冗余的接口
  3. 添加测试用例
  4. 更新说明文档
store.js -

Published by jaywcjlove over 8 years ago

store.js -

Published by jaywcjlove over 9 years ago

store.js -

Published by jaywcjlove over 9 years ago

store.js - store.js v1.0.1

Published by jaywcjlove over 9 years ago

  1. 添加UMD支持
  2. 修复store({key: data, key2: data})失效
  3. 弃用store(false)因为传入空值 或者报错很容易清空库
  4. 删除key/value,返回value
store.js - store

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   
Package Rankings
Top 1.66% on Npmjs.org
Top 26.39% on Repo1.maven.org
Badges
Extracted from project README
Buy me a coffee Downloads Build and test storejs Coverage Status README.md