8000 GitHub - hhqqnu/JsCache: Javascript cache
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hhqqnu/JsCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JsCache

JsCache 提供浏览器缓存,如COOKIES,LOCAL STORAGE,SESSION STORAGE

使用方法:

/**
 *
 * @param {CACHE SETTING} options
 * options
 *  type
 *    session SESSION STORAGE
 *    local   LOCAL STORAGE
 *    cookie  COOKIE STOREAGE
 *  vEnd COOKIE STORATE END DATE
 *  sPath COOKIE STORAGE PATH
 *  sDomain COOKIE STORATE DOMAIN
 *  bSecure COOKIE STORAGE SECURE
 *  isTemporary IS TEMPLATE STORAGE, USE SESSION STORAGE
 */
var cache = new JsCache({ type: 'cookie' }) // 初始化
cache.set('test', { name: 'tom1' }); // 设置
var val = cache.get('test'); //获取

// 临时调整缓存存储方式
var option = {
     type: 'local'
};
cache.setOption(option);

About

Javascript cache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0