UNPKG

@venix/cachified

Version:

A plug and play NestJS redis cache for intensive functions.

18 lines 663 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const IORedis = require("ioredis"); const config = {}; function ConfigureCachified(opts) { config.enabled = opts.enabled === undefined ? true : opts.enabled; if (opts.client) return config.client = opts.client; if (opts.redisConfig) return config.client = new IORedis(opts.redisConfig); throw new Error('No valid instance of redis was passed to Cachified config'); } exports.ConfigureCachified = ConfigureCachified; function GetConfig() { return config; } exports.GetConfig = GetConfig; //# sourceMappingURL=ConfigureCachified.js.map