Good day, help figure out:
In the training code I found an example:
const defer = require('config/defer').deferConfig; const path = require('path'); module.exports = { template: { // template.root uses config.root root: defer(function () { return path.join(this.root, 'templates'); }) }, root: process.cwd() }; This is used where in the code like this:
const templatePathResolved = path.join(config.template.root, templatePath + '.pug'); Question:
In 1, it is not clear what defer() . Documentation on this topic node-config / defer does not shed much light.
In 2 please explain why when accessing the configuration and calling the corresponding function, this in it refers to the exported object.
Thank.