
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@quikc/express
Advanced tools
This package contains middleware for integrating the caching library into your Express application.
@quikc/express - express middileware for Quikc a NodeJS caching library@quikc/express is an express middleware for @quikc/core a Node.js caching library that supports multiple cache providers and pluggable lock providers. It is designed to be framework-agnostic and can be used in any Node.js application.
@quikc/express contains an express middleware that can be used to cache responses. You can install it by running the following command:
npm install @quikc/core @quikc/express
# or
yarn add @quikc/core @quikc/express
You can use @quikc/core package to create you cache instance with the desired cache provider and then use the @quikc/express middleware to cache your responses.
import express from 'express';
import { createStore } from '@quikc/core';
import { QuikcExpress } from '@quikc/express';
const app = express();
const cache = createStore('memory');
const quikc = new QuikcExpress({
cache,
getKey: req => req.path,
shouldCache: (req, res) => req.method === 'GET' && res.statusCode === 200,
});
app.use(quikc.middleware);
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
});
The QuickExpress class accepts the following options:
cache - The cache instance created using createStore function from @quikc/core package.
getKey - A function that accepts the express request object and returns the cache key.
shouldCache - A function that accepts the express request and response objects and returns a boolean indicating whether the response should be cached or not.
cacheFallback - A boolean indicating whether to serve the cached response if the request fails or not.
cacheFallbackTTL - The TTL of the cached response in seconds.
cacheOptions - An object containing the cache options. This object is passed to the cache provider.
ttl - The TTL of the cached response in seconds.dependencies - An array of cache keys that the cached response depends on. If any of the dependencies is invalidated, the cached response will be invalidated as well.priority - The priority of the cached response. The higher the priority, the more likely the cached response will be served.lockTimeout - The lock timeout in milliseconds.onError - A function that accepts the express request and response objects and is called when an error occurs while serving the cached response.
onHit - A function that accepts the express request and response objects and is called when a cached response is served.
onMiss - A function that accepts the express request and response objects and is called when a cached response is not found.
onSkip - A function that accepts the express request and response objects and is called when a response is not cached.
onStore - A function that accepts the express request and response objects and is called when a response is stored in the cache.
Contributions are welcome! Please read the contributing guide for more information.
FAQs
This package contains middleware for integrating the caching library into your Express application.
We found that @quikc/express 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.