dir-config-loader
v0.0.1
Published
Loading yaml and json config files under a config, place them in namespaces, and listens on SIGHUP for reloading
Downloads
3
Readme
#dir-config-loader
This is a simple config loader that loads all the yml and json files from a folder and outputs into a structure, and reloads on SIGHUP signal
##Usage
npm install --save dir-config-loader
For example, you have the following folder structure
config/config.yml
some: config
config/folder/config.json
{
"some": "json"
}
import Configurer from "dir-config-loader";
Configurer.load("./config").then((configurer) => {
console.log(configurer.configs.config.some) // config
console.log(configurer.configs.folder.config.some) // json
});
##SIGHUP
kill -SIGHUP [pid]
all the configs will be cleared and reloaded based on the previous folder.