I cannot export a module that I wrote it myself in an asynchronous way.
const glob = require('glob');
var confFiles;
glob("conf/**/*.conf", function (er, files) {
confFiles = files;
});
module.exports = new Promise(function(resolve, reject) {
resolve(confFiles);
});
This is the module itself and I want to access confFiles
in other files but the point is that glob is not asynchronous and I'm having trouble finding my way to solve it.