Create instance of ConfigProfiler
class.
const ConfigProfiler = require('config-profiler');
const configProfiler = new ConfigProfiler('./path', {});
For more details about the options, see
ICoreOptions
andIChangeableOptions
.
Set a new workspace directory path.
configProfiler.setWorkspace('./path/to/workspace');
Set a new options.
configProfiler.setOptions({
configFiles: ['config.json', 'config.js']
});
For more details about the options, see
ICoreOptions
andIChangeableOptions
.
Get config for the current file path.
configProfiler.getConfig('./path/to/workspace/index.txt').then((result) => {
// console.log(result);
// { from: './path/to/workspace/config.json', config: { ok: true } }
});
Warning
Here available not all options. See only
IChangeableOptions
options.