1.1.0 • Published 2 years ago

h5-storage-cache v1.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
2 years ago

h5-storage-cache

安装

(c)npm install h5-storage-cache -D

使用

es6
  import H5StorageCache from 'h5-storage-cache';
API
 /**
   *
   * @property 配置
   * config: object
   *
   * @preserve 存储类型
   * storage: object
   *
   * @method 获取配置
   * getConfig(): object
   *
   * @method 设置缓存
   * set(key: string, value: any, expireTime?: number): void;
   *
   * @method 获取指定 key 缓存
   * get(key: string): any
   *
   * @method 判断指定 key 是否存在
   * has(key: string): boolean
   *
   * @method 指定 key 是否已经过期
   * isExpire(key: string): boolean
   *
   * @method 移除指定 key
   * remove(key: string): void
   *
   * @method 清除所有缓存
   * clear(): void
   *
   * @method 获取缓存的数量
   * getLength(): number
   *
   * @method 获取缓存的所有 key
   * getKeys(): string[]
   *
   * @method 获取所有缓存
   * getAll(): object[]
   *
   * @method 清除已经过期的缓存
   * clearExpire(): void
   * 
   * @method 获取指定 key 的信息
   * getInfo(key: string): object
   *
   * */