I built a node module for others to import into their node projects. I use config.js. I'm having issues telling their scripts where to look for my config directory is.
I'm using this code to define it within my module, but its doesn't cover all possible scenarios.
var config_dir = path.dirname(process.mainModule.filename)+path.sep+'node_modules'+path.sep+'open-payments'+path.sep+'config';
process.env.NODE_CONFIG_DIR=config_dir
I need something that will tell my module where to look regardless of what or where the script is that's using my module.