缓存机 源码
缓存机 基于redis的简单缓存 用法 const cache = require ( 'cache-machine' ) ( redis ) ; await cache . set ( 'my-key' , { test : true } ) ; await cache . get ( 'my-key' ) ; await cache . getAndDel ( 'my-key' ) ; const limited = await cache . rateLimit ( 'my-key' , 1 , 60 ) ; if ( limited ) console . log ( 'oh no'
下载地址
用户评论