@melchyore/adonis-cache
Version:
Cache package for AdonisJS V5
22 lines (21 loc) • 761 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineReplBindings = void 0;
/**
* Helper to define REPL state
*/
function setupReplState(repl, key, value) {
repl.server.context[key] = value;
repl.notify(`Loaded ${key} module. You can access it using the "${repl.colors.underline(key)}" variable`);
}
function defineReplBindings(application, Repl) {
/**
* Load the cache module
*/
Repl.addMethod('loadCache', (repl) => {
setupReplState(repl, 'Cache', application.container.resolveBinding('Adonis/Addons/Cache'));
}, {
description: 'Load cache provider and save reference to the "Cache" variable'
});
}
exports.defineReplBindings = defineReplBindings;