3.1.0 • Published 6 years ago
@dnode/redis v3.1.0
Usage
const redis = require('@dnode/redis')(process.env.REDIS_URL);
(async () => {
await redis.set('key', 'value', 1 * 60 * 60);
const value = await redis.get('key');
})();
If the expire is an object supporting asSeconds()
(e.g. @dnode/duration or moment.duration) it will be used.
const duration = require('@dnode/duration');
const redis = require('@dnode/redis')(process.env.REDIS_URL);
(async () => {
await redis.set('key', 'value', duration('1h'));
const value = await redis.get('key');
})();