Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
exp-rediscache
Advanced tools
A Redis caching library meant to be used with exp-asynccache.
Usage:
const cache = new AsyncCache(new RedisCache());
const hit = cache.lookup("foo", (resolve) => {
resolve(null, "baz");
});
hit.then((value) => {
console.log(value); // value will be "baz"
});
Values cached with a maxAge uses Redis's SETEX command and sets a TTL on the key.
const cache = new AsyncCache(new RedisCache());
const hit = cache.lookup("foo", (resolve) => {
resolve(null, "baz", 1000);
});
hit.then((value) => {
console.log(value); // value will be "baz"
});
The underlying Redis client will queue up any commands if Redis is down. If you want instant errors back you can set the enableOfflineQueue
option to false
. This allows exp-asynccache to transparently fall back to the resolve callback in such a case.
const cache = new AsyncCache(new RedisCache({
enableOfflineQueue: false
}));
To namespace your cache keys (in case you run multiple apps against the same Redis), you can specify the keyPrefix
option.
const cache = new AsyncCache(new RedisCache({
keyPrefix: "namespace"
}));
For local development and running tests:
$ npm ci
$ docker-compose up // starts the local redis instance
$ npm test
FAQs
A simple redis cache library
The npm package exp-rediscache receives a total of 59 weekly downloads. As such, exp-rediscache popularity was classified as not popular.
We found that exp-rediscache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.