
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@kaliber/cache
Advanced tools
Simple memory cache function.
Some times you want to cache a value but don't need a complex caching system. This package helps you cache values in side the memory of your application.
yarn add @kaliber/cache
import fetch from 'node-fetch'
import { createCache } from '@kaliber/cache'
const cache = createCache({ allowReturnExpiredValue: false, expirationTime: 1000 })
function handleRequest(postId) {
const data = cache({
cacheKey: ['post', postId],
async getValue() {
const response = await fetch(`https://jsonplaceholder.typicode.com/posts/${postId}`)
return await response.json()
}
})
return data
}
| Property | Value | Description |
|---|---|---|
| allowReturnExpiredValue | false | if false the expirationTime will be leading in getting results from the cache |
| allowReturnExpiredValue | true | if true the cache is in 'unsafe' safe mode this means that the cache will always return a value even if the cache time is expired. Of course the cache needs to have a value to get value from it. |
| expirationTime | number | (in milliseconds) this is the time the cache is valid. |
This library is intended for internal use, we provide no support, use at your own risk.
FAQs
Simple memory cache
The npm package @kaliber/cache receives a total of 5 weekly downloads. As such, @kaliber/cache popularity was classified as not popular.
We found that @kaliber/cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.