@maxdome/redis
v3.0.2
Published
```javascript const redis = require('@maxdome/redis')(process.env.REDIS_URL);
Downloads
2
Keywords
Readme
Usage
const redis = require('@maxdome/redis')(process.env.REDIS_URL);
await redis.setJSON('key', 'value', 1 * 60 * 60);
const value = await redis.getJSON('key');
If the expire is an object supporting asSeconds()
(e.g. @maxdome/duration or moment.duration) it will be used.
const duration = require('@maxdome/duration');
const redis = require('@maxdome/redis')(process.env.REDIS_URL);
await redis.setJSON('key', 'value', duration('1h'));
const value = await redis.getJSON('key');