
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
@commandkit/cache
Advanced tools
CommandKit plugin that provides caching apis
@commandkit/cache
CommandKit plugin for cache management.
npm install @commandkit/cache
To use the @commandkit/cache
plugin, you need to add it to your CommandKit application. This can be done by importing the plugin and adding it to your configuration.
import { cache } from '@commandkit/cache';
export default defineConfig({
plugins: [
cache(),
],
})
Next, you can define advanced configurations for the plugin if needed. For example, you can set a custom cache provider:
import { setCacheProvider } from '@commandkit/cache';
import { RedisCache } from '@commandkit/redis';
setCacheProvider(new RedisCache({...}));
Then, you can add "use cache"
directive to the function you want to cache. For example:
import { cacheTag, cacheLife } from '@commandkit/cache';
async function fetchDogs() {
"use cache";
cacheTag('dogs');
cacheLife('1h');
const dogs = await fetch('https://example.com/dogs');
return dogs.json();
}
Now the fetchDogs
function will be cached for 1 hour. You can perform on-demand cache invalidation or revalidation using the invalidate
and revalidate
methods:
import { invalidate, revalidate } from '@commandkit/cache';
async function refreshCache() {
// invalidate the cache for the "dogs" tag. This will remove the cached data.
// calling the function again will fetch fresh data.
await invalidate('dogs');
// revalidate the cache for the "dogs" tag. This will fetch fresh data and update the cache.
await revalidate('dogs');
}
FAQs
CommandKit plugin that provides caching apis
The npm package @commandkit/cache receives a total of 653 weekly downloads. As such, @commandkit/cache popularity was classified as not popular.
We found that @commandkit/cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.