tank-cache 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
tank-cache 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
tank-cache 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
开源组织
地区 国产
投 递 者 Tank-man
适用人群 未知
收录时间 2023-03-08

软件简介

tank-cache是一套基于nodejs的文件缓存插件,易于集成,Api可满足大部分项目的使用需求,文件存储位置配置,可通过npm进行安装

  • 安装
npm install --save tank-cache
  • 使用
//import tank-cache
const FileCache = require("tank-cache/index")

//default savePath process.cwd()+".runtime/cache.json"
const cache = new FileCache()
//use savePath
const cache = new FileCache(".runtime/mycache.json")
//store 
cache.Store("tank", "man", 1)
// or 
cache.Set("tank", "man", 1)
  • Api 列表
constructor(saveFilePath: any);

Has(key: any): any;

Get(key: any, defaultVal?: any): string | null;

Forever(key: any, val: any): void;

Forget(key: any): null | any;

Pull(key: any): string;

Store(key: any, val?: any, ttl?: number): any;

Set(key: any, val?: any, ttl?: number): any;

Add(key: any, val?: any, ttl?: number): boolean;

Flush(): void; 
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
1 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部