
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@opuscapita/cache
Advanced tools
Cache library for OpusCapita. By default it ships with three cache providers: dummy, memory and redis.
To have a look at the full API, please visit the related wiki page.
First got to your local code directory and run:
npm install @opuscapita/cache
If you are using the redis back-end, you'll need to have access to a running Consul server to get your endpoint configuration and a Redis server to connect to.
If all this is set up, go to you code and add the following command:
const Cache = require('@opuscapita/cache');
var cache = new Cache(); // using default: Memory driver
cache.put('hello', 'world').then(() => cache.get('hello')).then(console.log);
The default configuration object provides hints about what the module's standard behavior is like. In order to set plug-in (driver) specific configurations, you may add a sub-key to the configuration having the same name as the driver property you set and assign a configuration object there.
{
driver : 'memory',
keyPrefix: '',
defaultExpire: 600, // in seconds
pluginDirectory: 'plugins'
}
Example including memory driver configuration:
const Cache = require('@opuscapita/cache');
var cache = new Cache({
driver : 'memory',
keyPrefix: '',
checkPeriod: 10,
memory: {
checkPeriod: 600,
useClones: true
},
redis: {
consul: {
host: 'consul'
},
redis: {
endpointName: 'redis',
passwordKey: 'redis/password' // consul KV key name
}
}
});
If environment variable KUBERNETES_SERVICE_DISCOVERY is set then config library is not used at all for service discovery. Redis port is read from REDIS_PORT environment variable (6379 is used by default if variable not set).
There is a feature? which cause redis/redis/ path in the configuration... In the future version this shall change
{
driver: "redis",
redis: {
consul: {
host: "consul"
serviceSecretPath: '/path'
port:8500,
retryCount: 50,
retryTimeout: 1000,
logger: null,
},
redis: {
endpointName: "redis",
passwordKey: "redis/password",
},
},
}
Added new option to change redis retry interval and count.
FAQs
OpusCapita cache abstraction library
The npm package @opuscapita/cache receives a total of 150 weekly downloads. As such, @opuscapita/cache popularity was classified as not popular.
We found that @opuscapita/cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.