1.0.0 • Published 2 years ago

xhbcache v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

//引入这个模块 const file = require("./file") //生成缓存的方法 file.saveCache 有是三个参数 文件名 文件内容过期时间单位【秒】 file.saveCache("log.txt", '文件内容', 10) //读取缓存 如果在存储时设置了过期时间 那么他会判断是否过期否则删除 let res = file.readCache('log.txt') console.log(res); //生成文件方法 两个参数 文件名和文件内容 file.writeFile('log1.txt', '文件内容') //读取文件方法 参数一个文件名 let res1 = file.readFile('log1.txt') console.log(res1); //删除文件的方法 file.delFile('log1.txt')

1.0.0

2 years ago