@armit/cosmiconfig
Find and load configuration from a package.json property, rc file, or CommonJS module, also support .ts
file type:
it will search up the directory tree, checking each of these places in each directory, until it finds some acceptable configuration (or hits the home directory).
Alternative config loaer : https://github.com/egoist/joycon