Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
redis-cache-promise
Advanced tools
Readme
Very simple module to handle Redis cache key/value with promises
configure(Object)
: Set the configuration parameters to connect with Redis, Return the instance of the redis-cache-promise
Promise connect()
: Connect with Redis, return a promise.
var Cache = require('redis-cache-promise')
var cache = new Cache()
cache
.configure({
host: '192.168.1.36',
db: 0, //optional default 0
expiry: 5, //optional default 86400
password: '123', //optional
})
.connect()
.then(function () {
cache.set('key',
{
value: 'object'
},
{
expiry: 5 // in seconds from now
})
.then(function (value) {
console.log(value)
}).catch(function (err) {
throw err
})
var interval = setInterval(function () {
cache.get('key')
.then(function (value, key) {
console.log('the value of', key, ' => ', value)
if (!value) {
console.log(key, 'expired')
clearInterval(interval)
}
})
.catch(function (err) {
throw err
})
cache.get('key 2')
.otherwise(function (deferred, key) {
var newValue = 'newValue 2'
console.log(key, 'without value, this function will set the value to ' + newValue)
return deferred(newValue, {
expiry: 3
})
})
.then(function (value, key) {
console.log('the value of', key, ' => ', value)
})
.catch(function (err) {
throw err
})
}, 1000)
})
.catch(function (err) {
throw err
})
#Version 0.1.1
FAQs
Nodejs Module to handle redis cache with promises
The npm package redis-cache-promise receives a total of 3 weekly downloads. As such, redis-cache-promise popularity was classified as not popular.
We found that redis-cache-promise 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.