@dnode/redis

3.1.0 • Public • Published

dependencies | 1 | 25

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');
})();

Dependents (0)

Package Sidebar

Install

npm i @dnode/redis

Weekly Downloads

1

Version

3.1.0

License

MIT

Unpacked Size

3.57 kB

Total Files

4

Last publish

Collaborators

  • sharaal