
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
@nioh/cache
Advanced tools
内存缓存 in-memory cache
const Cache = require('@poseidon/runtime-cache')
const runtimeCache = new Cache({
debug: false,
max: 100,
overcut: 10 // 溢出时,需要清除的缓存百分比
})
get(key) 获取
let cache = runtimeCache.get('aaa')
判断过期后的处理
// 在 controller 中使用
if (cache && cache.expired && !cache.fetching) {
cache.fetching = true
await apiService()
cache.fetching = false
}
set(key, value, duration) 设置
runtimeCache.set('aaa', {b:1,c:1}, 60)
注:过期时间单位为秒
remove(key) 移除
runtimeCache.remove('aaa')
clear 清除
runtimeCache.clear()
FAQs
cache with weight, in-memory
We found that @nioh/cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.