UNPKG

rest-envelop

Version:

Wrapper for working with REST API using well-known axios and node-fetch modules

9 lines (6 loc) 365 B
const { Redis, Memcached } = require('cache-envelop'); const { REDIS_CACHE_SERVICE, MEMCACHED_CACHE_SERVICE } = require('../constants'); module.exports = ({ redis, memcached: { servers, options } = {} }) => ({ redis: () => new Redis(redis).client, memcached: () => new Memcached(servers, options), }[redis ? REDIS_CACHE_SERVICE : MEMCACHED_CACHE_SERVICE]());